Oniguruma question

J

Jonas Galvez

I've just installed oniguruma (gem install) and tried this:

reg = Oniguruma::ORegexp.new("\p{Lu}", {
:encoding => Oniguruma::ENCODING_UTF8
})

Shouldn't it match "A"? reg.match("A") returns nil.

--Jonas Galvez
 
S

Stefan Rusterholz

Jonas said:
I've just installed oniguruma (gem install) and tried this:

reg = Oniguruma::ORegexp.new("\p{Lu}", {
:encoding => Oniguruma::ENCODING_UTF8
})

Shouldn't it match "A"? reg.match("A") returns nil.

Unfortunately Oniguruma fails to compile here so I can't test, but I
think your problem is your string.
"\p" == "p". If you want a literal \p, you need to do either "\\p" or
'\p'.

Regards
Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,318
Members
47,998
Latest member
GretaCjy4

Latest Threads

Top