Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Oniguruma question
Jonas Galvez
8/6/2007 9:30:00 PM
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
1 Answer
Stefan Rusterholz
8/7/2007 1:49:00 AM
0
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
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Oniguruma question
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password