javascript - How to allow Regex expression with Spaces -


var validate = /^[@#&%][a-za-z0-9]{4}$/; 

i need allow spaces in regex.

you need this:

var validate = /^[@#&%][a-za-z0-9 ]{4}$/; 

note, add space within brackets.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -