How do I ensure a text box is alphanumeric but without a leading digit?

后端 未结 2 1458
渐次进展
渐次进展 2021-01-28 11:42

My web application contains a text box for which I would like to restrict its input. I would like to prevent the user from entering text that:

  • Starts with white s
2条回答
  •  遇见更好的自我
    2021-01-28 12:09

    Not to start with white space of alpha numeric: [a-zA-Z]+
    Followed by 0 or more alphanumeric: [a-zA-Z0-9]*

    Final expression

    ^[a-zA-Z]+[a-zA-Z0-9]*$
    

提交回复
热议问题