Created
July 23, 2010 11:24
-
-
Save zby/487312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Devel::Peek; | |
binmode(STDOUT,":utf8"); | |
for my $letter ( "\x{0411}", 'A' ){ | |
print "Letter $letter\n"; | |
Dump $letter; | |
if( $letter =~ /p{Latin}/ ){ | |
print "matched p{Latin}: $1\n"; | |
} | |
if( $letter =~ /p{^Latin}/ ){ | |
print "matched p{^Latin}: $1\n"; | |
} | |
if( $letter =~ /P{Latin}/ ){ | |
print "matched P{Latin}: $1\n"; | |
} | |
if( $letter =~ /P{^Latin}/ ){ | |
print "matched p{^Latin}: $1\n"; | |
} | |
if( $letter =~ /p{Cyrillic}/ ){ | |
print "matched p{Cyrillic}: $1\n"; | |
} | |
if( $letter =~ /p{^Cyrillic}/ ){ | |
print "matched p{^Cyrillic}: $1\n"; | |
} | |
if( $letter =~ /P{Cyrillic}/ ){ | |
print "matched P{Cyrillic}: $1\n"; | |
} | |
if( $letter =~ /P{^Cyrillic}/ ){ | |
print "matched p{^Cyrillic}: $1\n"; | |
} | |
} | |
__OUTPUT__ | |
Letter Б | |
SV = PV(0xe57268) at 0xe70f60 | |
REFCNT = 2 | |
FLAGS = (POK,READONLY,pPOK,UTF8) | |
PV = 0xe7ad00 "\320\221"\0 [UTF8 "\x{411}"] | |
CUR = 2 | |
LEN = 8 | |
Letter A | |
SV = PV(0xe57418) at 0xe70ea0 | |
REFCNT = 2 | |
FLAGS = (POK,READONLY,pPOK) | |
PV = 0xe829d0 "A"\0 | |
CUR = 1 | |
LEN = 8 | |
__VERSION__ | |
This is perl 5, version 12, subversion 1 (v5.12.1) built for x86_64-linux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved now: p{... should be \p{...