Regular Expression for alphabets with spaces

前端 未结 8 1919
庸人自扰
庸人自扰 2020-12-13 18:34

I need help with regular expression. I need a expression which allows only alphabets with space for ex. college name.

I am using :

var regex = /^[a-         


        
8条回答
  •  天涯浪人
    2020-12-13 18:47

    Regular expression starting with lower case or upper case alphabets but not with space and can have space in between the alphabets is following.

    /^[a-zA-Z][a-zA-Z ]*$/
    

提交回复
热议问题