in reply to Orthography Translation using Regex
$string=s/r/‰/g;
Note that you could pack all the original strings and their translations into a hash, and then use a loop to translate all of them. I'm not sure that would buy you much, readability-wise - except that it could sort by the length of original string for you.
and the definitions would look like this:sub bylen { length($b)<=>length($a)} # sorts by decreasing length of s +tring foreach (sort keys bylen %trans) { s/$_/$trans{$_}/g; }
etc....$trans{Mh}='´'; $trans{gh}='³';
|
|---|