I have a regex that is trying to capture integer numbers like
12_456_789
But the delimiter can by either any of [\ _.,]
or no delimiter. My regex looks like
\d{1,3}((_\d{3})*|(\ \d{3})*|(\.\d{3})*|(,\d{3})*|(\d{3})*)
This regex works as epxected, but it's annoying having to repeat myself for each delimiter. I'm tempted to do something like
\d{1,3}(([\ _.,]\d{3})*)
But this would match a string like
123,456.789_987
which is not acceptable.
Is there some kind of abbreviation along the lines of my temptation that can be used? Or am I stuck with conjunction repetition?
I'm working in python verbose regex.