in reply to Re: I just cannot figure out the greedy regex
in thread I just cannot figure out the greedy regex

Just to ammend to the post by Coruscate that you might also want to handle escaped quotes with the following regex:
s/"(?:\\"|.)*?"//g;

Replies are listed 'Best First'.
Re: Re: Re: I just cannot figure out the greedy regex
by !1 (Hermit) on Dec 16, 2003 at 07:34 UTC

    And just to amend to the post by Roger that you might also want to remove quoted strings with newlines in them, lest you wish to end up with very strange results, with the following regex:

    s/"(?:\\"|.)*?"//gs;