How to filter the special characters, not including the French letters, using regular expressions

前端 未结 1 1115
遇见更好的自我
遇见更好的自我 2021-01-16 13:52

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

1条回答
  •  盖世英雄少女心
    2021-01-16 14:18

    You can use this:

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

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

    Reference

    French orthography

    0 讨论(0)
提交回复
热议问题