Regex for reccuring tuples with brackets separated by comma

Viewed 15

I am struggling for a while already, hence this question.

I am looking for a Regex that would match the following pattern:

(1,2),(2,3),(3,4) etc.

Assumptions:

  • 1 or more (number,number) "tuples" separated by comma
  • must end with the tuple, not the comma or any other char (!)

The closest I got is: (?:(\d+,\d+),)+

but this also accepts a string with a comma at the end, which should not be the case.

Thank You!

0 Answers
Related