Makistos
10/28/2013 - 7:45 AM

Checks if a string has letters in it properly, i.e. all Unicode characters are considered letters. #regexp #unicode #perl

Checks if a string has letters in it properly, i.e. all Unicode characters are considered letters. #regexp #unicode #perl

#!/usr/bin/perl

while (<>) {
  if (/[\p{L}]+/) {
    print "letters\n";
  } else {
    print "no letters\n";
  }
}