I am searching for a regular expression for allowing alphanumeric characters, -, _ or spaces in JavaScript/jQuery.
How can this be done?
Advertisement
Answer
Try this regex:
/^[a-zd-_s]+$/i
I am searching for a regular expression for allowing alphanumeric characters, -, _ or spaces in JavaScript/jQuery.
How can this be done?
Try this regex:
/^[a-zd-_s]+$/i