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

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -