Search code examples
regexunicodespecial-characters

Regular Expression To Anglicize String Characters?


Is there a common regular expression that replaces all known special characters in non-English languages:

é, ô, ç, etc.

with English characters:

e, o, c, etc.

Solution

  • No, there is no such regex. Note that with a regex you "describe" a specific piece of text.

    A certain regex implementation might provide the possibility to do replacements using regex, but these replacements are usually only performed by a single replacement: not replace a with a' and b with b' etc.

    Perhaps the language you're working with has a method in its API to perform this kind of replacements, but it won't be using regex.