From: Jeremy Henty Date: 2007-04-18T01:40:09+09:00 Subject: Re: Regular expression help 2 On 2007-04-17, Guest wrote: > 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 ... >>> Script starts #!/bin/sh ruby -wnle 'puts %r{^(.*?)(\s*/\*.*\*/\s*)?$}.match($_).captures[0]' <>> Output starts Mary had a little lamb <<< Output ends Regards, Jeremy Henty