summaryrefslogtreecommitdiff
path: root/pod/perlre.pod
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-08-20 11:19:50 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-09-23 05:42:41 +0000
commit0f5d15d614a56a8b655f35e4e8c6a0dba34da106 (patch)
treec3140d2320518142ad6ef0414aa648605d09b0a6 /pod/perlre.pod
parent51882d45c6d36f86de12444364ecbbfe87b21ab4 (diff)
downloadperl-0f5d15d614a56a8b655f35e4e8c6a0dba34da106.tar.gz
patch to support computed regular subexpressions
Message-Id: <199808201919.PAA04692@monk.mps.ohio-state.edu> Subject: [5.005_5* PATCH] Postponed RE - now! p4raw-id: //depot/perl@1813
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r--pod/perlre.pod22
1 files changed, 22 insertions, 0 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod
index f696525155..6ecb7ad12a 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -399,6 +399,28 @@ checks, thus to allow $re in the above snippet to contain C<(?{})>
I<with tainting enabled>, one needs both C<use re 'eval'> and untaint
the $re.
+=item C<(?p{ code })>
+
+I<Very experimental> "postponed" regular subexpression. C<code> is evaluated
+at runtime, 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.
+
+C<code> is not interpolated. Currently the rules to
+determine where the C<code> ends are somewhat convoluted.
+
+The following regular expression matches matching parenthesized group:
+
+ $re = qr{
+ \(
+ (?:
+ (?> [^()]+ ) # Non-parens without backtracking
+ |
+ (?p{ $re }) # Group with matching parens
+ )*
+ \)
+ }x;
+
=item C<(?E<gt>pattern)>
An "independent" subexpression. Matches the substring that a