diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-10-12 15:30:05 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-10-12 15:30:05 +0000 |
commit | 1209ba901e0b2880eea69ad70613848af5543517 (patch) | |
tree | 5f95fbab5155907bf49140ca545292a3e8267190 /pod/perlre.pod | |
parent | 26744161d10595c3db74919d9b07ee8f8354b06a (diff) | |
download | perl-1209ba901e0b2880eea69ad70613848af5543517.tar.gz |
Revert the parts of #3926 that outlawed character ranges
that have character classes such as \w as either endpoint.
This change re-establishes the old behavior which meant that
such ranges weren't really ranges, the "-" was literal.
Moreover, this change also fixes the old behavior to be
more consistent: [\w-.] and [\s-\w] worked, but [.-\w] didn't.
Now they all do work as described above. The #3926 outlawed
all of those.
p4raw-id: //depot/cfgperl@4355
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r-- | pod/perlre.pod | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod index 9a06305629..1610254da5 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -185,8 +185,9 @@ Use C<\w+> to match a string of Perl-identifier characters (which isn't the same as matching an English word). If C<use locale> is in effect, the list of alphabetic characters generated by C<\w> is taken from the current locale. See L<perllocale>. You may use C<\w>, C<\W>, C<\s>, C<\S>, -C<\d>, and C<\D> within character classes (though not as either end of -a range). See L<utf8> for details about C<\pP>, C<\PP>, and C<\X>. +C<\d>, and C<\D> within character classes, but if you try to use them +as endpoints of a range, that's not a range, the "-" is understood literally. +See L<utf8> for details about C<\pP>, C<\PP>, and C<\X>. The POSIX character class syntax @@ -940,6 +941,9 @@ at the start or end of the list, or escape it with a backslash. (The following all specify the same class of three characters: C<[-az]>, C<[az-]>, and C<[a\-z]>. All are different from C<[a-z]>, which specifies a class containing twenty-six characters.) +Also, if you try to use the character classes C<\w>, C<\W>, C<\s>, +C<\S>, C<\d>, or C<\D> as endpoints of a range, that's not a range, +the "-" is understood literally. Note also that the whole range idea is rather unportable between character sets--and even within character sets they may cause results |