In the question here, I got the regexp to match one (or more) group of digits between 1 and 99 separated by | or , (both can be combined).
I want to update it to do the
Just remove first occurrence of ?:. It makes group optional. So you have two optional groups that accepts empty string.
?:
Also you can simplify [0-9]|[1-9][0-9] to [1-9]?[0-9] (? means first digit is optional)
[0-9]|[1-9][0-9]
[1-9]?[0-9]
?
Result:
^([1-9]?[0-9])(?:[,|][1-9]?[0-9])*$