KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've got following text 'some-text-here' and try to get the 'text' word from it using groups. If I use that expression /some-(\w+)-here/ all works fine, but if I try to apply grouping to it /some-(?<group_name>\w+)-here/ it's raise an error Undefined (?...) sequence. What's I doing wrong? (Ruby 1.9.2) Upd: shame on me. It's all from my innatention. Yes, I've use RVM and my ruby version turned on 1.9.2. But I've tested that expression at http://rubular.com/ where it is written at the footer Rubular runs on Ruby 1.8.7 . Ruby 1.8.7 and Ruby 1.9.2 have a different regular expression engine. So my expression works on 1.9.2, but does not on 1.8.7
Tags (comma-separated)
Save Edits
Cancel