开发者

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]+,)+
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜