简体   繁体   中英

How to match words in different languages by JavaScript regexp?

I have a strings in different languages. I need to get only characters without numbers, '-', '/', ')', ... But seams JavaScript regexp '\\w' matches only English.
http://jsfiddle.net/d9BRC/

After a bit of research, it seems \\w does not handle unicode characters, you can do this with \\p{L} (Letters), but again javascript does not support this.

Here is a solution , taken from this answer

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