Regexp match error on windows and unicode error on linux

Hi,

I have a small problem with Regexp to match accented latin letters. I
need this to match french words and [\wéèàÉÀ...] is the only way I found
that works for me but it's not great.

I made a test file encoded in UTF-8

···

_________________________
#coding: UTF-8

puts "é accepted by [a-z]" if "é" =~ /[a-z]/
puts "é accepted by \\w" if "é" =~ /\w/
puts "é accepted by \p{L}" if "é" =~ /\p{L}/

__END__

On windows 7 with Ruby1.9 I get:
  é accepted by p{L}

On linux I get and error:
  test.rb:5: invalid character property name {L}: /\p{L}/

then if I remove line 5 I get:
  é accepted by \w

Errors seems to come from my Ruby installation and we can see that it
would be perfect if we combine the skills of the one on windows with the
one on linux.

Does anyone have a solution to correct the \w of windows or the error on
linux ? only one would be great.

Thanks
--
Posted via http://www.ruby-forum.com/.

On windows 7 with Ruby1.9 I get:
  é accepted by p{L}

On linux I get and error:
  test.rb:5: invalid character property name {L}: /\p{L}/

then if I remove line 5 I get:
  é accepted by \w

Errors seems to come from my Ruby installation and we can see that it
would be perfect if we combine the skills of the one on windows with the
one on linux.

Does anyone have a solution to correct the \w of windows or the error on
linux ? only one would be great.

seems to fit the bill (if you're using different versions of ruby on the
two). Maybe you can enlighten us all when you find a fix :slight_smile:

-rp

···

--
Posted via http://www.ruby-forum.com/\.

I think there is no solution but reporting a bug

···

--
Posted via http://www.ruby-forum.com/.