Regular Expression related: first character alphabet second onwards alphanumeric+some special characters

前端 未结 3 1630
無奈伤痛
無奈伤痛 2021-02-06 03:46

I have one question related with regular expression. In my case, I have to make sure that first letter is alphabet, second onwards it can be any alphanumeric + some special char

3条回答
  •  长发绾君心
    2021-02-06 04:17

    Try this :

     /^[a-zA-Z]{1}/
    

    where

     ^ -> Starts with 
     [a-zA-Z] -> characters to match 
     {1} -> Only the first character
    

提交回复
热议问题