From: 7stud -- Date: 2009-04-29T11:37:12+09:00 Subject: Re: Issue with regexp pattern matcher withing String#gsub Craig Jolicoeur wrote: > ## the question is why can I do string concat with + $1 in the first > regexp and > ## why am I unable to do it in the second regexp where doing str + $1 > throws the error?? There's no match with the second regex, so all of the regex $ variables are set to nil. Your second regex requires that the character "?" be in the string. It isn't. -- Posted via http://www.ruby-forum.com/.