Stanisław T. Findeisen wrote:
Hi how to write regular expressions matching against Unicode (eg., UTF-8) strings?

For instance, in my regexp:

qr/^([.<>@ \w])*$/

Decode the UTF-8 encoded strings before applying the regex on them.

$ perl -MEncode -le '
$utf8_encoded = "smörgåsbord";
$s = decode "UTF-8", $utf8_encoded;
print "Match" if $s =~ /^\w+$/;
'
Match
$

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to