From: Craig Jolicoeur Date: 2009-04-29T22:18:13+09:00 Subject: Re: Issue with regexp pattern matcher withing String#gsub 7stud -- wrote: > ...and that means the error message you posted can't occur. When I run > the code: > > str = %q{src="/foo/bar.png"} > > str.gsub!( /src=(["'])\S+\?\d*\1/ ) { |s| s.split('?').first + $1 } > > there are no errors and no output. So you must have done something > differently in your code. you don't get an error because your initial quote doesnt make the match. try it with this instead str = %q{src="/foo/bar.png?12345"} you will get the error in that case since the regexp pattern is found. the pattern wasn't found in your test -- Posted via http://www.ruby-forum.com/.