summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-04-23 01:34:55 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-23 09:04:31 +0000
commite1d1eefb8c88e0dcaf2bb9e6c04d7f6192be966f (patch)
tree6930eda70a9e751e8789ca568d015204ca292552 /pod
parent8638e433f90c5046b38f1d145c125bad5dbfdb7e (diff)
downloadperl-e1d1eefb8c88e0dcaf2bb9e6c04d7f6192be966f.tar.gz
Change meaning of \v, \V, and add \h, \H to match Perl6, add \R to match PCRE and unicode tr18
Message-ID: <9b18b3110704221434g43457742p28cab00289f83639@mail.gmail.com> p4raw-id: //depot/perl@31026
Diffstat (limited to 'pod')
-rw-r--r--pod/perlre.pod18
1 files changed, 15 insertions, 3 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod
index 66935d25f3..18652321e1 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -233,7 +233,7 @@ An unescaped C<$> or C<@> interpolates the corresponding variable,
while escaping will cause the literal string C<\$> to be matched.
You'll need to write something like C<m/\Quser\E\@\Qhost/>.
-=head3 Character classes
+=head3 Character Classes and other Special Escapes
In addition, Perl defines the following:
X<\w> X<\W> X<\s> X<\S> X<\d> X<\D> X<\X> X<\p> X<\P> X<\C>
@@ -265,8 +265,11 @@ X<word> X<whitespace> X<character class> X<backreference>
\x12 Hexadecimal escape sequence
\x{1234} Long hexadecimal escape sequence
\K Keep the stuff left of the \K, don't include it in $&
- \v Shortcut for (*PRUNE)
- \V Shortcut for (*SKIP)
+ \v Vertical whitespace
+ \V Not vertical whitespace
+ \h Horizontal whitespace
+ \H Not horizontal whitespace
+ \R Linebreak (matches like \v inside of a charclass)
A C<\w> matches a single alphanumeric character (an alphabetic
character, or a decimal digit) or C<_>, not a whole word. Use C<\w+>
@@ -283,6 +286,15 @@ your own C<\p> and C<\P> properties, and L<perluniintro> about Unicode
in general.
X<\w> X<\W> X<word>
+C<\R> will atomically match a linebreak, including the network line-ending
+"\x0D\x0A". Specifically, X<\R> is exactly equivelent to
+
+ (?>\x0D\x0A?|[\x0A-\x0C\x85\x{2028}\x{2029}])
+
+B<Note:> C<\R> has no special meaning inside of a character class;
+use C<\v> instead (vertical whitespace).
+X<\R>
+
The POSIX character class syntax
X<character class>