summaryrefslogtreecommitdiff
path: root/pod/perlrebackslash.pod
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-10-27 10:18:34 -0600
committerKarl Williamson <public@khwilliamson.com>2011-10-27 10:56:06 -0600
commit1978b668ca7817baf02fb20a49327ab82da3bcd4 (patch)
treef5cc50443a699b835bf2f950b668f5d150654e5c /pod/perlrebackslash.pod
parent4f03b4b68c373d6b483f2a44808498ec2c2bf9f7 (diff)
downloadperl-1978b668ca7817baf02fb20a49327ab82da3bcd4.tar.gz
PATCH: [perl #99928] Document that is not a bug
After consulting with Tom Christiansen, we decided that this is not a bug. The CR-LF sequence is considered a unit by Unicode, and so should be inseperable, even when separating the two would cause a pattern to match that otherwise fails.
Diffstat (limited to 'pod/perlrebackslash.pod')
-rw-r--r--pod/perlrebackslash.pod9
1 files changed, 8 insertions, 1 deletions
diff --git a/pod/perlrebackslash.pod b/pod/perlrebackslash.pod
index 0ce42b4515..1a64849e21 100644
--- a/pod/perlrebackslash.pod
+++ b/pod/perlrebackslash.pod
@@ -603,7 +603,14 @@ linebreak sequence by Unicode. This includes all characters matched by
C<\v> (vertical whitespace), and the multi character sequence C<"\x0D\x0A">
(carriage return followed by a line feed, sometimes called the network
newline; it's the end of line sequence used in Microsoft text files opened
-in binary mode). C<\R> is equivalent to C<< (?>\x0D\x0A|\v) >>. Since
+in binary mode). C<\R> is equivalent to C<< (?>\x0D\x0A|\v) >>. (The
+reason it doesn't backtrack is because the sequence is considered
+inseperable. That means that
+
+ "\x0D\x0A" =~ /^\R\x0A$/ # No match
+
+fails, because the C<\R> matches the entire string, and won't backtrack
+to match just the C<"\x0D">.) Since
C<\R> can match a sequence of more than one character, it cannot be put
inside a bracketed character class; C</[\R]/> is an error; use C<\v>
instead. C<\R> was introduced in perl 5.10.0.