From: Andrew Stewart Date: 2007-03-23T01:52:32+09:00 Subject: Re: Knocking Lines Out Of A Multiline String On 22 Mar 2007, at 15:22, Rob Biedenharn wrote: > >> input.gsub(%r{^.*/usr/local/lib/.*\n?},'') > > If you showed your code, an explanation could be added as to your > regexp, but the concept certainly works as I've shown. Aha! You have proved that I chose my regexp poorly. Here's what I tried: input.gsub(%r{^.*/usr/local/lib/.*$}i, '') The difference is that yours consumes the new line character but mine doesn't. I should have just matched it explicitly like you rather than using an anchor. Thanks and regards, Andy Stewart