From: The Higgs bozo Date: 2009-03-10T16:41:41+09:00 Subject: Re: Regexp problem Albert Schlef wrote: > I want to extract an "id" parameter from the URL. I use the following > code: > > url = "http://example.com/id=12345" > id = url[ /(?<=id=)(\d+)/ ] > puts id > > But I get a SyntaxError telling me "undefined (?...) sequence". > > Why? Because ruby 1.8 does not have look-behind. 1.9 has it, and your code runs on 1.9. If you need 1.8 with look-behind, I guess you can compile 1.8 with the Oniguruma regexp engine (which is used in 1.9). -- Posted via http://www.ruby-forum.com/.