Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: delayed interpolation of regexps & recursion

by bikeNomad (Priest)
on Jul 27, 2001 at 18:25 UTC ( #100311=note: print w/replies, xml ) Need Help??


in reply to delayed interpolation of regexps & recursion

I think what he's referring to is the (??{}) facility. From perlre:
"(??{ code })" WARNING: This extended regular expression feature is considered highly experimental, and may be changed or deleted without notice. A simplified version of the syntax may be introduced for commonly used idioms. This is a "postponed" regular subexpression. The "code" is evaluated at run time, at the moment this subexpression may match. The result of evaluation is considered as a regular expression and matched as if it were inserted instead of this construct. The "code" is not interpolated. As before, the rules to determine where the "code" ends are currently somewhat convoluted. The following pattern matches a parenthesized group: $re = qr{ \( (?: (?> [^()]+ ) # Non-parens without backtracking | (??{ $re }) # Group with matching parens )* \) }x;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://100311]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2021-05-11 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (111 votes). Check out past polls.

    Notices?