简体   繁体   中英

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

我使用replace(/[^\\w\\s]|_/g, "").replace(/\\s+/g, " ")可以过滤所有特殊字符,但我不想过滤法语字母。

You can use this:

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

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

Reference

French orthography

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM