my $string = 'e1ņe'; if ($string =~ /^\w+$/) { print "yes"; } else { print "no"; } print "\n"; __OUTPUT___ yes