I'm currently somewhat stuck getting a regular expression in Perl (taken from an earlier question of mine) to match word characters from a non-ASCII locale (i.e., German umlauts).
I already tried various things such as setting the correct locale (using setlocale), converting data that I receive from MySQL to UTF8 (using decode_utf8), and so on... Unfortunately, to no avail. Google also did not help much.
Is there any chance to get the following regex locale-aware so that
$street = "Täststraße"; # I know that this is not orthographically correct
$street =~ s{
\b (\w{0,3}) (\w*) \b
}
{
$1 . ( '*' x length $2 )
}gex;
ends up returning $street = "Täs*******"
instead of "Tästs***ße"
?