in reply to A NOT in regular expressions

That depends, is there any chance that % will appear in between <% and %>? If not, then something as simple as this should work:

s/<%[^%]%>>//g;

However, I must warn you, because you have a 2 character delimiter (<% and %>), if you have input like:

stuff <% junk% %> more stuff

Then the substitution will fail.

Replies are listed 'Best First'.
Re: Re: A NOT in regular expressions
by Monky Python (Scribe) on May 14, 2003 at 07:55 UTC
    Hi, I think you forgot the +.
    s/<%[^%]+%>//g;
    MP