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