Reputation: 1167
I am having problems allowing white spaces in js with regex. I am not sure what it is, but I have been searching and not able to find an answer that works.
I am really new to regex, so please be kind for being ignorant of something this simple.
Here is my allowed characters currently:
var validChar = /^[A-Z0-9]+$/i;
If I add a space in it, it will not work: /^[A-Z 0-9]+$/i
What do I have to do in order to make it recognize a space?
Upvotes: 1
Views: 88