Regex for Comma delimited list

everLearningStudent picture everLearningStudent · Sep 8, 2009 · Viewed 152.5k times · Source

What is the regular expression to validate a comma delimited list like this one:

12365, 45236, 458, 1, 99996332, ......

Answer

Asaph picture Asaph · Sep 8, 2009

I suggest you to do in the following way:

(\d+)(,\s*\d+)*

which would work for a list containing 1 or more elements.