I'd say your file's encoding is not what you think it is.
use strict; use warnings; use Data::Dumper; use utf8; my $str = " 1 i á \x{3C3} _ "; # \x{3C3} = small sigma warn Dumper $str; $str =~ s/\w+//g; # delete all alpha-nums warn Dumper $str; warn "WORKS!" if $str =~ m/^ +$/;
C:/Strawberry/perl/bin\perl.exe -w d:/tmp/pm/utf8.pl $VAR1 = " 1 i \x{e1} \x{3c3} _ "; $VAR1 = ' '; WORKS! at d:/tmp/pm/utf8.pl line 12.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
*) PM has problems displaying unicode characters like "σ" inside code tags
In reply to Re: UTF8 versus \w in pattern matching (basic test)
by LanX
in thread UTF8 versus \w in pattern matching
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |