X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlre.pod;h=1336c5c24d4fd5c3291f5fcc9eeb59ebb76d3f7b;hb=6d1e6673d7386f4f9139111a6e44d555b8252741;hp=04c7b8e724deef9d48b62244b21c1dbf33201733;hpb=384f06ae49854089e0cf13ffe34560627ea86f8a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlre.pod b/pod/perlre.pod index 04c7b8e..1336c5c 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -271,6 +271,7 @@ X X X X \g{name} Named backreference \k Named backreference \K Keep the stuff left of the \K, don't include it in $& + \N Any character but \n \v Vertical whitespace \V Not vertical whitespace \h Horizontal whitespace @@ -315,26 +316,34 @@ they must always be used within a character class expression. # this is not, and will generate a warning: $string =~ /[:alpha:]/; -The available classes and their backslash equivalents (if available) are -as follows: -X +The following table shows the mapping of POSIX character class +names, common escapes, literal escape sequences and their equivalent +Unicode style property names. +X X<\p> X<\p{}> X X X X X X X X X X X X X X - alpha - alnum - ascii - blank [1] - cntrl - digit \d - graph - lower - print - punct - space \s [2] - upper - word \w [3] - xdigit +B up to Perl 5.10 the property names used were shared with +standard Unicode properties, this was changed in Perl 5.11, see +L for details. + + POSIX Esc Class Property Note + -------------------------------------------------------- + alnum [0-9A-Za-z] IsPosixAlnum + alpha [A-Za-z] IsPosixAlpha + ascii [\000-\177] IsASCII + blank [\011 ] IsPosixBlank [1] + cntrl [\0-\37\177] IsPosixCntrl + digit \d [0-9] IsPosixDigit + graph [!-~] IsPosixGraph + lower [a-z] IsPosixLower + print [ -~] IsPosixPrint + punct [!-/:-@[-`{-~] IsPosixPunct + space [\11-\15 ] IsPosixSpace [2] + \s [\11\12\14\15 ] IsPerlSpace [2] + upper [A-Z] IsPosixUpper + word \w [0-9A-Z_a-z] IsPerlWord [3] + xdigit [0-9A-Fa-f] IsXDigit =over @@ -344,8 +353,9 @@ A GNU extension equivalent to C<[ \t]>, "all horizontal whitespace". =item [2] -Not exactly equivalent to C<\s> since the C<[[:space:]]> includes -also the (very rare) "vertical tabulator", "\cK" or chr(11) in ASCII. +Note that C<\s> and C<[[:space:]]> are B equivalent as C<[[:space:]]> +includes also the (very rare) "vertical tabulator", "\cK" or chr(11) in +ASCII. =item [3] @@ -361,33 +371,21 @@ whole character class. For example: matches zero, one, any alphabetic character, and the percent sign. -The following equivalences to Unicode \p{} constructs and equivalent -backslash character classes (if available), will hold: -X X<\p> X<\p{}> +=item C<$> + +Currency symbol + +=item C<+> C<< < >> C<=> C<< > >> C<|> C<~> + +Mathematical symbols - [[:...:]] \p{...} backslash - - alpha IsAlpha - alnum IsAlnum - ascii IsASCII - blank - cntrl IsCntrl - digit IsDigit \d - graph IsGraph - lower IsLower - print IsPrint - punct IsPunct - space IsSpace - IsSpacePerl \s - upper IsUpper - word IsWord - xdigit IsXDigit - -For example C<[[:lower:]]> and C<\p{IsLower}> are equivalent. - -If the C pragma is not used but the C pragma is, the -classes correlate with the usual isalpha(3) interface (except for -"word" and "blank"). +=item C<^> C<`> + +Modifier symbols (accents) + +=back + +=back The other named classes are: @@ -432,9 +430,9 @@ X POSIX traditional Unicode - [[:^digit:]] \D \P{IsDigit} - [[:^space:]] \S \P{IsSpace} - [[:^word:]] \W \P{IsWord} + [[:^digit:]] \D \P{IsPosixDigit} + [[:^space:]] \S \P{IsPosixSpace} + [[:^word:]] \W \P{IsPerlWord} Perl respects the POSIX standard in that POSIX character classes are only supported within a character class. The POSIX character classes