in reply to Greedy RegExp

You can also use negative lookahead to ensure that you don't have (for example) multiple src tags between the img and WantToGetRidOfThis.gif:
/<img(?!.*src=.*src=WantToGetRidOfThis.gif).*?WantToGetRidOfThis.gif.+ +?>/

The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re: Re: Greedy RegExp
by fourmi (Scribe) on Mar 15, 2004 at 16:18 UTC
    negative lookahead. will need to read up about that one!
    cheers again!