Regex to match only letters

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

How can I write a regex that matches only letters?

20条回答
  •  自闭症患者
    2020-11-22 16:41

    /^[A-z]+$/.test('asd')
    // true
    
    /^[A-z]+$/.test('asd0')
    // false
    
    /^[A-z]+$/.test('0asd')
    // false
    

提交回复
热议问题