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
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
Jonas Galvez wrote:
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs