I am trying to replace all German special characters in a Regular Expression. The Characters are ä ö ü ß
I don't think you can do all 4 (or 7) replacements with a single regexp. It's fairly easy, thought, to do it with 4 (or 7) regexps.
Update
Additionally, as Mic has indicated, regexps can be part of the solution but need to be part of some kind of replacing mechanism. More input needed here.
/ä/ae/
If Carl is correct about what replacements you're talking about, that'll do; but regexs are not really required here, it can be done with a simple string function/methods.
Of course, for each character you'd need to write new regex.
If you wanted to replace them all with a single character, e.g., a question mark (?
), you could use the following regex:
/[äöüß]/?/ig
If you want to replace each of those characters with a different character, you'll need four regexes:
/ä/X1/
/ö/X2/
/ü/X3/
/ß/X4/
where X1-X4 are the four replacement characters
OR, if you want to replace any occurrences of those characters with a single character:
/[äöüß]/X/
where X is the replacement character.
The exact regex syntax may different, depending on the programming language.