I am trying to match comma separated numbers, but if any of the numbers is not valid stop regex and don't match it at all.
Here is an example that should be matched
3123123213212,3123123263212,3173123213212
This string shouldn't be matched
3123123213212,3123123263212dad,3173123213212
So at least one invalid number should lead to unmatched regex.
What I've tried is the following expression
(?:(\d+)(?=\,|\s|$))+
Here is Regex101 link
https://regex101.com/r/JpuA5X/1
The problem that even if some number is invalid it matches other numbers, but this is not acceptable.
How can I modify my regex to get desired result ?
Thanks.
UPDATE
Sorry, I haven't mentioned, I need to group every single number.