develooper Front page | perl.perl6.language.regex | Postings from September 2000

Re: XML/HTML-specific ?< and ?> operators?

From:
Mark-Jason Dominus
Date:
September 11, 2000 20:59
Subject:
Re: XML/HTML-specific ?< and ?> operators?
Message ID:
20000912035934.23103.qmail@plover.com

> : it looks worse and dumps core.
> 
> That's because the first non-paren forces it to recurse into the
> second branch until you hit REG_INFTY or overflow the stack. Swap
> second and third branches and you have a better chance:

I think something else goes wrong there too.  


>   $re = qr{...}
> (I haven't checked that there aren't other problems with it, though.)

Try this:

        "(x)(y)" -~ /^$re$/;

This should match, but it dumps core.  I don't think there is infinite
recursion, although I might be mistaken.

Anyway, Snobol has a nice heuristic to prevent infinite recursion in
cases like this, but I'm not sure it's applicable to the way the Perl
regex engine works.  I will think about it.




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