Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Regex Matching Unicode and Regex Classes

by McA (Priest)
on Nov 02, 2011 at 13:53 UTC ( [id://935400] : perlquestion . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    #!/usr/bin/perl -CO
    use strict;
    print "UTF8-Flag: ", utf8::is_utf8($b) ? "Yes" : "No";
    print "    matches word: ", $b =~ /\w/ ? "Yes" : "No";
    print "\n";
  2. or download this
    UTF8-Flag: Yes    matches word: Yes
    UTF8-Flag: No    matches word: No
    UTF8-Flag: Yes    matches word: No
    UTF8-Flag: No    matches word: No