Regex to match comma separated values?
I am looking for a regular expression which accepts comma separated values(no space) of both string开发者_JAVA技巧 and numbers(especially mobile numbers, 10 digits) for client side validation.
I have gone through regexlib.com
but i couldn't find good one.
UPDATE
Input patterns:
9655770780,college,8095145098,schoolmates
Its a just a input field, users can enter group name of mobile numbers or just the numbers.
Any suggestions!
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
Try this pattern. This will verify if a text is a comma separated
([a-zA-Z0-9]+,)+
精彩评论