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
  • 44,500
  • 61
  • 101
  • 156
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
  • 41,100
  • 9
  • 89
  • 105