3 ms·
You have to tell perl to expect utf8 from stdin (switch -C). $ echo '੧' | perl -C -pe 'print "yes: " if m/\d/' and $ perl -e 'use utf8; print "yes\n" if
by xonea 13y ago
You have to tell perl to expect utf8 from stdin (switch -C).
$ echo '੧' | perl -C -pe 'print "yes: " if m/\d/'
and
$ perl -e 'use utf8; print "yes\n" if "੧" =~ m/\d/;'
both work :)
- pooriaazimi 13y ago`man perlunicode` is chockfull of utf8-related stuff (and it's looong): http://perldoc.perl.org/5.14.0/perlunicode.html http://perldoc.perl.org/5.14.0/perlunicode.html