in reply to "Not containing something" in substitution
(??{ 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;
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: "Not containing something" in substitution
by CombatSquirrel (Hermit) on Aug 28, 2003 at 12:39 UTC | |
by Aristotle (Chancellor) on Aug 28, 2003 at 12:57 UTC | |
|
Re: Re: "Not containing something" in substitution
by BrowserUk (Patriarch) on Aug 28, 2003 at 19:14 UTC | |
by Aristotle (Chancellor) on Aug 28, 2003 at 21:33 UTC | |
by BrowserUk (Patriarch) on Aug 28, 2003 at 22:00 UTC |