develooper Front page | perl.perl5.porters | Postings from September 1999

Re: Regular Expression bug

From:
Ilya Zakharevich
Date:
September 6, 1999 18:10
Subject:
Re: Regular Expression bug
Message ID:
199909070110.VAA12361@monk.mps.ohio-state.edu
Ilya Zakharevich writes:
> > IMO this really has to work in order for me to be able to grep through
> > C/C++ code.
> 
> Nope.  Your REx is very unefficient.

I see that part of this discussion leaked to p5p, and part not.

What I meant is that the effective (and less demanding on the stack
size) way to treat things like this is

  "((?>[^"\\]+)|\\.)*"

Some other idea of Ed: C<*> could notice that it is inside (?>), and
could do no backtracing at all.

Ilya



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About