Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有不同语言的字符串。我只需要获取没有数字的字符,'-','/',')',...但是接缝 JavaScript regexp '\w' 只匹配英语。 http://jsfiddle.net/d9BRC/
经过一番研究,似乎\w不处理 unicode 字符,您可以使用\p{L}(Letters) 执行此操作,但再次 javascript 不支持此操作。
\w
\p{L}
这是一个解决方案,取自这个答案