diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-07-07 21:30:15 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-08 07:47:00 +0000 |
commit | ca9dfc883b7dc3204e375cea5d38c48cb1715f83 (patch) | |
tree | 510fdde168170962a0dc6faf6270ef32069ea093 /pod | |
parent | aece5585ce03c55b3c5a73afd84e1b977acd5360 (diff) | |
download | perl-ca9dfc883b7dc3204e375cea5d38c48cb1715f83.tar.gz |
Switch modifiers in RE off
Message-Id: <199807080530.BAA14072@monk.mps.ohio-state.edu>
p4raw-id: //depot/perl@1375
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlre.pod | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod index f6fdc29eea..c72a71c0ac 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -277,6 +277,8 @@ C<)> in the comment. =item C<(?:pattern)> +=item C<(?imsx-imsx:pattern)> + This is for clustering, not capturing; it groups subexpressions like "()", but doesn't make backreferences as "()" does. So @@ -288,6 +290,15 @@ is like but doesn't spit out extra fields. +The letters between C<?> and C<:> act as flags modifiers, see +L<C<(?imsx-imsx)>>. In particular, + + /(?s-i:more.*than).*million/i + +is equivalent to more verbose + + /(?:(?s-i)more.*than).*million/i + =item C<(?=pattern)> A zero-width positive lookahead assertion. For example, C</\w+(?=\t)/> @@ -448,7 +459,7 @@ Say, matches a chunk of non-parentheses, possibly included in parentheses themselves. -=item C<(?imsx)> +=item C<(?imsx-imsx)> One or more embedded pattern-match modifiers. This is particularly useful for patterns that are specified in a table somewhere, some of @@ -464,6 +475,8 @@ pattern. For example: $pattern = "(?i)foobar"; if ( /$pattern/ ) { } +Letters after C<-> switch modifiers off. + These modifiers are localized inside an enclosing group (if any). Say, ( (?i) blah ) \s+ \1 |