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

Making the (?: ) into a (?> ) should also fix that without removing the pluses, no?

Makeshifts last the longest.

  • Comment on Re^4: A NOT in regular expressions (why [^%>]?)

Replies are listed 'Best First'.
Re: Re^4: A NOT in regular expressions (why [^%>]?)
by BrowserUk (Patriarch) on May 14, 2003 at 11:28 UTC

    Um, no.

    $s = '1 <% xxx%%> 2 <%%> 3 <%>%> 4 <% >% %> 5 <%%%% xxx %%%%> 6 '; $s =~ s/<% (?> [^%]+ | %+ [^>]+ )* %>/!REPLACED!/xg; print $s; 1 !REPLACED!%> 4 <% >% %> 5 <%%%% xxx %%%%> 6

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller