In Perl, I usually use the transliteration to count the number of characters in a string that match a set of possible characters. Things like:
$c1=($a =~ y[\x{0410}-\x{042F}\x{0430}-\x{044F}]
[\x{0410}-\x{042F}\x{0430}-\x{044F}]);
would count the number of Cyrillic characters in $a. As in the previous example I have two classes (or two ranges, if you prefer), I have some other with some more classes:
$c4=($a =~ y[\x{AC00}-\x{D7AF}\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{A960}-\x{A97F}\x{D7B0}-\x{D7FF}]
[\x{AC00}-\x{D7AF}\x{1100}-\x{11FF}\x{3130}-\x{318F}\x{A960}-\x{A97F}\x{D7B0}-\x{D7FF}]);
Now, I need to do a similar thing in Java. Is there a similar construct in Java? Or I need to iterate over all characters, and check if it is between the limits of each class?
Thank you