Regex to match only letters

后端 未结 20 1534
孤城傲影
孤城傲影 2020-11-22 16:24

How can I write a regex that matches only letters?

相关标签:
20条回答
  • 2020-11-22 16:46

    Just use \w or [:alpha:]. It is an escape sequences which matches only symbols which might appear in words.

    0 讨论(0)
  • 2020-11-22 16:50

    You can try this regular expression : [^\W\d_] or [a-zA-Z].

    0 讨论(0)
提交回复
热议问题