1

I use replace(/[^\w\s]|_/g, "").replace(/\s+/g, " ") can filter all special character, but I don't want filter the French letters.

rink.attendant.6
  • 40,889
  • 58
  • 100
  • 149
tianji
  • 13
  • 3

1 Answers1

0

You can use this:

/[^\w\sàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒ]/g

You don't need special treatment for the _ as it is included in \w

Reference

French orthography

zx81
  • 39,708
  • 9
  • 81
  • 104