Oleg Dats
Oleg Dats

Reputation: 4133

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/

Upvotes: 0

Views: 2239

Answers (1)

epoch
epoch

Reputation: 16615

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

Upvotes: 3

Related Questions