in reply to Re: Re^2: A NOT in regular expressions (why [^%>]?)
in thread A NOT in regular expressions

The first one fails by not stopping soon enough for "<% %%> %>". The second fails by not matching "<% %% %>".

Thanks for the thoughts.

                - tye

Replies are listed 'Best First'.
Re: Re^4: A NOT in regular expressions (thanks)
by idsfa (Vicar) on Nov 02, 2003 at 00:04 UTC

    Cribbing from Mastering Regular Expressions' section on removing C-style quotes ...

    qr{ <% [^%]* %+ ( [^>%] [^%]* %+ )* > }x;

    appears to properly handle every example in this thread, as well as not taking forever on a failed match.


    Remember, when you stare long into the abyss, you could have been home eating ice cream.