fork download
  1. #!/usr/bin/perl
  2. use utf8;
  3. binmode STDOUT, ":utf8";
  4.  
  5. my $re = qr/\N{LATIN SMALL LETTER A WITH MACRON AND GRAVE}/u;
  6. my @cases = ("\x{0101}", "\x{0300}", "\x{0101}\x{0300}");
  7.  
  8. for my $str (@cases) {
  9. if ( $str =~ $re ) {
  10. print ("matches $re: $str\n");
  11. } else {
  12. print ("does not match $re: $str\n");
  13. }
  14. }
Success #stdin #stdout 0.02s 24232KB
stdin
Standard input is empty
stdout
does not match (?^u:\N{U+101.300}): ā
does not match (?^u:\N{U+101.300}): ̀
matches (?^u:\N{U+101.300}): ā̀