How to do a regex that allow only: numbers, alphabetic, spaces and comma(,) for javascript?

How to do a regex that allow only: numbers, alphabetic, spaces and comma(,) for javascript?
MrFahadAsked:
Who is Participating?
 
ddrudikCommented:
1 or more times:
/^[\da-z ,]+$/i
0 or more times:
/^[\da-z ,]*$/ig;
0
 
MrFahadAuthor Commented:
hmm what you mean by 1 or more times and 0 or more times thank you :)
0
 
ddrudikCommented:
Do you want to allow empty input?  If so, use the 0 pattern, if not, use the 1 pattern.
0
 
MrFahadAuthor Commented:
very fast reply less than 1min i swear i almost thought that this an auto reply lol :p
great job
0
 
ddrudikCommented:
Thanks for the question and the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.