JavaScript + Unicode regexes

前端 未结 11 1414
星月不相逢
星月不相逢 2020-11-21 05:11

How can I use Unicode-aware regular expressions in JavaScript?

For example, there should be something akin to \\w that can match any code-point in Lette

11条回答
  •  孤城傲影
    2020-11-21 05:46

    As mentioned in other answers, JavaScript regexes have no support for Unicode character classes. However, there is a library that does provide this: Steven Levithan's excellent XRegExp and its Unicode plug-in.

提交回复
热议问题