ruby regex and grouping -
I got the text I will call it What am I doing? (Ruby 1.9.2) All this is from my innate Yes, I have used RVM and my Ruby version 1.9.2 is in progress. But I have tested that expression where it runs in footer It seems to me that you are looking at the wrong Ruby. Do you have RVM installed? 1.9.2 1.8.7 'some-lesson here' and <
/ some - (\ W +) - here / all the work is fine, but if I use that expression, then
/ some - (? , it increases an error
undefined (? ...) sequence?
ruble 1.8.7 in ruble. Ruby 1.8.7 and Ruby 1.9.2 have a different regular expression engine. On <1.8.7 No
& gt; & Gt; RUBY_VERSION = & gt; "1. 9.2" & gt; & Gt; S = 'Some-Text-Here' = & gt; "Some text here" & gt; & Gt; / Something - (? & Lt; group_name & gt; \ w +) - here = / ~ s = & gt; 0 & gt; & Gt; Group_name # = & gt; "Text"
& gt; & Gt; RUBY_VERSION = & gt; "1.8.7" & gt; & Gt; S = 'Some-Text-Here' = & gt; "Some text here" & gt; & Gt; / Something - (? Group_name & gt; \ w +) - here / = ~ s syntax error: compile error (irb): 2: undefined (? ...) sequence: / something - (? & Lt; Group_name & gt; \ w +) - From here (IRB): 2
Comments
Post a Comment