summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-08-10 13:30:11 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-08-10 13:30:11 +0000
commite5a7b00343749c7d105ae604c729e7f14b9e23db (patch)
treef2e64edab85bdde0f60d6328d9135f4ffd4f12ef /pod
parent30487ceba2ac5c35e693d7aba544e73d6a7dc3f0 (diff)
downloadperl-e5a7b00343749c7d105ae604c729e7f14b9e23db.tar.gz
Further tweaks on perlreref.pod (by Iain Truskett)
p4raw-id: //depot/perl@20594
Diffstat (limited to 'pod')
-rw-r--r--pod/perlreref.pod41
1 files changed, 21 insertions, 20 deletions
diff --git a/pod/perlreref.pod b/pod/perlreref.pod
index 8aad32719a..8d8868156a 100644
--- a/pod/perlreref.pod
+++ b/pod/perlreref.pod
@@ -11,7 +11,7 @@ as the L<references|/"SEE ALSO"> section in this document.
=head1 OPERATORS
=~ determines to which variable the regex is applied.
- In its absence, C<$_> is used.
+ In its absence, $_ is used.
$var =~ /foo/;
@@ -26,39 +26,40 @@ as the L<references|/"SEE ALSO"> section in this document.
x eXtended legibility - free whitespace and comments
c don't reset pos on fails when using /g
- If C<pattern> is an empty string, the last I<successfully> match
- regex is used. Delimiters other than C</> may be used for both this
+ If 'pattern' is an empty string, the last I<successfully> match
+ regex is used. Delimiters other than '/' may be used for both this
operator and the following ones.
qr/pattern/imsox lets you store a regex in a variable,
- or pass one around. Modifiers as for C<m//> and are stored
+ or pass one around. Modifiers as for m// and are stored
within the regex.
s/pattern/replacement/igmsoxe substitutes matches of
- C<pattern> with C<replacement>. Modifiers as for C<m//>
- with addition of C<e>:
+ 'pattern' with 'replacement'. Modifiers as for m//
+ with one addition:
e Evaluate replacement as an expression
'e' may be specified multiple times. 'replacement' is interpreted
as a double quoted string unless a single-quote (') is the delimiter.
- ?pattern? is like C<m/pattern/> but matches only once. No alternate
+ ?pattern? is like m/pattern/ but matches only once. No alternate
delimiters can be used. Must be reset with 'reset'.
=head1 SYNTAX
- \ Escapes the character(s) immediately following it
- . Matches any single character except a newline (unless /s is used)
- ^ Matches at the beginning of the string (or line, if /m is used)
- $ Matches at the end of the string (or line, if /m is used)
- * Matches the preceding element 0 or more times
- + Matches the preceding element 1 or more times
- ? Matches the preceding element 0 or 1 times
- {...} Specifies a range of occurrences for the element preceding it
- [...] Matches any one of the characters contained within the brackets
- (...) Groups regular expressions
- | Matches either the expression preceding or following it
+ \ Escapes the character(s) immediately following it
+ . Matches any single character except a newline (unless /s is used)
+ ^ Matches at the beginning of the string (or line, if /m is used)
+ $ Matches at the end of the string (or line, if /m is used)
+ * Matches the preceding element 0 or more times
+ + Matches the preceding element 1 or more times
+ ? Matches the preceding element 0 or 1 times
+ {...} Specifies a range of occurrences for the element preceding it
+ [...] Matches any one of the characters contained within the brackets
+ (...) Groups subexpressions for capturing to $1, $2...
+ (?:...) Groups subexpressions without capturing (cluster)
+ | Matches either the expression preceding or following it
\1, \2 ... The text from the Nth group
=head2 ESCAPE SEQUENCES
@@ -165,7 +166,6 @@ Quantifiers are greedy by default --- match the B<longest> leftmost.
=head2 EXTENDED CONSTRUCTS
(?#text) A comment
- (?:...) Cluster without capturing
(?imxs-imsx:...) Enable/disable option (as per m//)
(?=...) Zero-width positive lookahead assertion
(?!...) Zero-width negative lookahead assertion
@@ -174,7 +174,7 @@ Quantifiers are greedy by default --- match the B<longest> leftmost.
(?>...) Grab what we can, prohibit backtracking
(?{ code }) Embedded code, return value becomes $^R
(??{ code }) Dynamic regex, return value used as regex
- (?(cond)yes|no) cond being int corresponding to capturing parens
+ (?(cond)yes|no) cond being integer corresponding to capturing parens
(?(cond)yes) or a lookaround/eval zero-width assertion
=head1 VARIABLES
@@ -279,6 +279,7 @@ David P.C. Wollmann,
Richard Soderberg,
Sean M. Burke,
Tom Christiansen,
+Jim Cromie,
and
Jeffrey Goff
for useful advice.