0

Is there a generic way using Regex to replace special characters in international text preserving diacritics, Chinese characters and whitespace?

e.g.

!$"$hello^&( !"$there<>? => hello there

!übèr# => übèr

##黃!! => 黃

I can list individual characters to replace for example which is taken from https://stackoverflow.com/a/6555220/1245362

string = string.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '');

Is there a more generic way using regex to remove all special characters?

JustinHui
  • 677
  • 5
  • 17

0 Answers0