Regex to match only letters

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

How can I write a regex that matches only letters?

20条回答
  •  北海茫月
    2020-11-22 16:28

    You would use

    /[a-z]/gi
    

    []--checks for any characters between given inputs

    a-z---covers the entire alphabet

    g-----globally throughout the whole string

    i-----getting upper and lowercase

提交回复
热议问题