Why does \w match only English words in javascript regex?

后端 未结 10 908
借酒劲吻你
借酒劲吻你 2020-12-09 20:26

I\'m trying to find URLs in some text, using javascript code. The problem is, the regular expression I\'m using uses \\w to match letters and digits inside the URL, but it d

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 20:36

    If you're the one generating URLs with non-english letters in it, you may want to reconsider.

    If I'm interpreting the W3C correctly, URLs may only contain word characters within the latin alphabet.

提交回复
热议问题