How Can I Run a Regex that Tests Text for Characters in a Particular Alphabet or Script?
- by Eli
I'd like to make a regex in Perl that will test a string for a characters in a particular string. This would be something like:
$text =~ .*P{'Chinese'}.*
Is there a simple way of doing this, for English it's pretty easy by just testing for [a-zA-Z], but for a script like Chinese, or one of the Japanese scripts, I can't figure out any way of doing this short of writing out every character explicitly, which would make for some very ugly code. Ideas? I can't be the first/only person that's wanted to do this.