Eric Hodel
4/6/2009 5:42:00 AM
On Apr 4, 2009, at 12:40, I=F1aki Baz Castillo wrote:
> Hi, using TreeTop parser I had a grammar defined working in Ruby1.8 =20=
> but it
> fails in 1.9.1:
>
> ~# ruby1.8 -e "Regexp.new('[\xC0-\xDF]')"
> OK
>
> ~# ruby1.9 -e "Regexp.new('[\xC0-\xDF]')"
> -e:1:in `initialize': invalid multibyte escape: /[\xC0-\xDF]/ =20
> (RegexpError)
>
> I've found the following text about differences between 1.8 and 1.9:
>
> "It is more rigorous that 1.8 when it comes to detecting invalid =20
> code. For
> example, 1.8 accepts /[^\x00-\xa0]/u, while 1.9 complains of invalid =20=
> multibyte
> escape"
>
> Ok, so how should I write the above Regexp to work on 1.9.1?
Regexp.new '[\xC0-\xDF]', nil, 'n'