summaryrefslogtreecommitdiff
path: root/pod/perlre.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-08-05 17:25:19 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-08-05 17:25:19 +0000
commit9373385978348b5aad2d5fb3ea78b7db27600a69 (patch)
tree0361db780aceb375c2fe77e7189f17b7fcba7da1 /pod/perlre.pod
parent0e8f60dd43c9e8276bfd6598ee62ebf70fa0c631 (diff)
downloadperl-9373385978348b5aad2d5fb3ea78b7db27600a69.tar.gz
Fix regex charclass parsing so that bogus ranges
like [0-\d] and [[:word:]-z] are no more allowed. The anomaly was noticed by Guy Decoux. p4raw-id: //depot/cfgperl@3926
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r--pod/perlre.pod14
1 files changed, 9 insertions, 5 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod
index 85b2a949c2..a1a118f371 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -217,7 +217,7 @@ character class. For example:
matches one, zero, any alphabetic character, and the percentage sign.
The exact meanings of the above classes depend from many things:
-if the C<utf8> pragma is used, the following equivalenced to Unicode
+if the C<utf8> pragma is used, the following equivalences to Unicode
\p{} constructs hold:
alpha IsAlpha
@@ -238,7 +238,7 @@ For example, [:lower:] and \p{IsLower} are equivalent.
If the C<utf8> pragma is not used but the C<locale> pragma is, the
classes correlate with the isalpha(3) interface (except for `word',
-which is a Perl extension).
+which is a Perl extension, mirroring \w).
The assumedly non-obviously named classes are:
@@ -249,6 +249,8 @@ The assumedly non-obviously named classes are:
Any control character. Usually characters that don't produce
output as such but instead control the terminal somehow:
for example newline and backspace are control characters.
+ All characters with ord() less than 32 are most often control
+ classified as characters.
=item graph
@@ -275,9 +277,11 @@ The assumedly non-obviously named classes are:
You can negate the [::] character classes by prefixing the class name
with a '^'. This is a Perl extension. For example:
- ^digit \D \P{IsDigit}
- ^space \S \P{IsSpace}
- ^word \W \P{IsWord}
+ POSIX trad. Perl utf8 Perl
+
+ [:^digit:] \D \P{IsDigit}
+ [:^space:] \S \P{IsSpace}
+ [:^word:] \W \P{IsWord}
The POSIX character classes [.cc.] and [=cc=] are B<not> supported
and trying to use them will cause an error.