From: Adam Bozanich Date: 2007-04-18T01:45:13+09:00 Subject: Re: Regular expression help 2 ------=_Part_56506_29275449.1176828304996 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 4/17/07, Guest wrote: > > Okay had such a great response before and learned lots but how about > another question? > > have some strings such as: > > blahblah /* comment */ > blahblah > blah blah > blah blah blah /* comment etc */ > > And i want just the blahblah bit, not any comments if there are any. str =<<-EOS blahblah /* comment */ blahblah blah blah blah blah blah /* comment etc */ EOS puts str.gsub(/\/\*.*/,'') This won't work for multi-line comments unfortunately. -Adam ------=_Part_56506_29275449.1176828304996--