From: Jarkko Hietaniemi Date: Mon, 1 Oct 2001 14:51:20 +0000 (+0000) Subject: Also the ^Is is optional. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61247495ece8f182b8387d5edcd26d5a5a7eaf4e;p=p5sagit%2Fp5-mst-13.2.git Also the ^Is is optional. p4raw-id: //depot/perl@12293 --- diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod index 4d6be20..43ab5cb 100644 --- a/pod/perlunicode.pod +++ b/pod/perlunicode.pod @@ -187,11 +187,12 @@ You can also negate both C<\p{}> and C<\P{}> by introducing a caret (^) between the first curly and the property name: C<\p{^InTamil}> is equal to C<\P{InTamil}>. -The C can be left out: C<\p{Greek}> is equal to C<\p{InGreek}>. +The C and C can be left out: C<\p{Greek}> is equal to +C<\p{InGreek}>, C<\P{Pd}> is equal to C<\P{Pd}>. -Here is the list as of Unicode 3.1.1 (the two-letter classes) and -as defined by Perl (the one-letter classes) (in Unicode materials -what Perl calls C is often called C): +Here is the list as of Unicode 3.1.1 (the two-letter classes) and as +defined by Perl (the one-letter classes) (what Perl calls C is +often in Unicode materials called C): L Letter Lu Letter, Uppercase @@ -324,8 +325,8 @@ version has C appended to its name, C<\p{InKatakanaBlock}>. Notice that this definition was introduced in Perl 5.8.0: in Perl 5.6.0 only the blocks were used; in Perl 5.8.0 scripts became the -preferential character class definition; this meant that the -definitions of some character classes changed (the ones in the +preferential Unicode character class definition; this meant that +the definitions of some character classes changed (the ones in the below list that have the C appended). BasicLatin diff --git a/t/op/pat.t b/t/op/pat.t index 50258b9..e65db55 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -6,7 +6,7 @@ $| = 1; -print "1..730\n"; +print "1..738\n"; BEGIN { chdir 't' if -d 't'; @@ -2153,30 +2153,55 @@ print "# some Unicode properties\n"; print "not " if "a" =~ /\p{IsLu}/; print "ok 721\n"; - print "not " unless "A" =~ /\pL/; + print "not " unless "a" =~ /\p{Ll}/; print "ok 722\n"; - print "not " unless "A" =~ /\p{IsLu}/; + print "not " if "a" =~ /\p{Lu}/; print "ok 723\n"; - print "not " if "A" =~ /\p{IsLl}/; + print "not " unless "A" =~ /\pL/; print "ok 724\n"; - print "not " if "a" =~ /\PL/; + print "not " unless "A" =~ /\p{IsLu}/; print "ok 725\n"; - print "not " if "a" =~ /\P{IsLl}/; + print "not " if "A" =~ /\p{IsLl}/; print "ok 726\n"; - print "not " unless "a" =~ /\P{IsLu}/; + print "not " unless "A" =~ /\p{Lu}/; print "ok 727\n"; - print "not " if "A" =~ /\PL/; + print "not " if "A" =~ /\p{Ll}/; print "ok 728\n"; - print "not " if "A" =~ /\P{IsLu}/; + print "not " if "a" =~ /\PL/; print "ok 729\n"; - print "not " unless "A" =~ /\P{IsLl}/; + print "not " if "a" =~ /\P{IsLl}/; print "ok 730\n"; + + print "not " unless "a" =~ /\P{IsLu}/; + print "ok 731\n"; + + print "not " if "a" =~ /\P{Ll}/; + print "ok 732\n"; + + print "not " unless "a" =~ /\P{Lu}/; + print "ok 733\n"; + + print "not " if "A" =~ /\PL/; + print "ok 734\n"; + + print "not " if "A" =~ /\P{IsLu}/; + print "ok 735\n"; + + print "not " unless "A" =~ /\P{IsLl}/; + print "ok 736\n"; + + print "not " if "A" =~ /\P{Lu}/; + print "ok 737\n"; + + print "not " unless "A" =~ /\P{Ll}/; + print "ok 738\n"; + }