Skip to content Skip to sidebar Skip to footer

Regex To Match Comma Separated Values?

I am looking for a regular expression which accepts comma separated values(no space) of both string and numbers(especially mobile numbers, 10 digits) for client side validation. I

Solution 1:

Regular expressions may be overkill for this problem.

You could use:

var csv_values = csv_string.split(",");

This would split on the commas and give you your values

Solution 2:

Try this pattern. This will verify if a text is a comma separated

([a-zA-Z0-9]+,)+

Post a Comment for "Regex To Match Comma Separated Values?"