In javascript how can i use regex to validate comma with characters. I’m doing this
return /^[a-zA-Z_-]+$/i.test(value);
which is working perfect but I want to add comma like this
return /^[a-zA-Z_-,]+$/i.test(value);
which is not working.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Inside a character class,
-is a special character (indicating a range between the preceding and the following character) unless it is the first or last character in the class: