I need a some help to replace all non-word characters in a string.
As an example (stadtbezirkspräsident' should become stadtbezirkspräsident.
This Regex should work for all languages so it’s kind of tricky because I have no idea how to match characters like ñ or œ. I tried solving this with
string.replace(/[&\/\\#,+()$~%.'":*?<>-_{}]/g,' ');
but ther are still to many special characters like Ø left.
Perhaps there is a general Selector for this, or anybody has solved this problem before?
If you have define all the Unicode ranges yourself, it’s going to be a lot of work.
It might make more sense to use Steven Levithan’s
XRexExppackage with Unicode add-ons and utilize its Unicode property shortcuts: