The $line contains unicode comma.
use strict;
use utf8;
my $line = "Spy,qqq,Iwm";
$line =~ s/[^a-zA-Z u002cu002e]+//g;
print $line."\n";
When i run it, i get $ perl 1.pl
SpyqqqIwm
Any suggestions ?
The character in question is U+FF0C FULLWIDTH COMMA
You can use it literally.
s/[^a-zA-Z ,,.]+//g
Alternatively, you can use one of the following in double-quoted and regex literals:
\N{U+FF0C}
\N{FULLWIDTH COMMA}
\x{FF0C}
For example,
s/[^a-zA-Z ,\N{U+FF0C}.]+//g
u002c
should be\x{002c}
or\x2c
or,
u002e
should be\x{002e}
or\x2e
or.
use open ':std', ':encoding(UTF-8)'
or-CS
on the commandline).