From: James Edward Gray II Date: 2004-10-05T23:08:52+09:00 Subject: Re: Regexp match question on interpolated strings... On Oct 4, 2004, at 10:27 PM, Richard Kilmer wrote: > If I had the source for a string: > > "name = #{person.first_name+" "+person.last_name} ... Ok?" > > And assuming I could find the first and last double quotes, how would I > parse out the #{ ... } with a regular expression since anything can > fall > between the #{ ... } braces in a string? I would use: .sub(/^(.+?)\#\(.+\}/m, '\1') Hope that helps. James Edward Gray II