Regular Expression for alphabets with spaces

前端 未结 8 1920
庸人自扰
庸人自扰 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:35

    This will work for not allowing spaces at beginning and accepts characters, numbers, and special characters

    /(^\w+)\s?/
    

提交回复
热议问题