Hi,
I came across a problem in a gsub and boiled it down to this difference,
can anyone explain?
>> b="trying to match whole string"
=> "trying to match whole string"
>> b.gsub(/(.+)/,'MATCH:\1')
=> "MATCH:trying to match whole string"
That operated the way I expected, but:
>> b.gsub(/(.*)/,'MATCH:\1')
=> "MATCH:trying to match whole stringMATCH:"
What is with that second match?
Thanks,
Lou
--
Posted via http://www.ruby-forum.com/.