From: 7stud -- Date: 2009-03-10T18:18:30+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? url = "http://example.com/id=12345" pieces = url.split("/") id = pieces[-1].split("=")[1] puts id --output:-- 12345 -- Posted via http://www.ruby-forum.com/.