We have filenames that contain product numbers at the start and based on this we apply processing when adding them to the system
i need a regex that should match the following
70707_70708_70709_display1.jpg
70707_Front010.jpg
and NOT these
626-this files is tagged.jpg
1000x1000_webbanner2.jpg
2000 years ago_files.jpg
626gamingassets_styleguide.jpg
70707_Front010_0001_1.jpg
i have a regex that almost does what i want except for one case highlighted below
\d{3,}(?=_)
70707_70708_70709_display1.jpg - success 3 matches {70707,70708,70709}
70707_Front010.jpg - success 1 match {70707 }
626-this files is tagged.jpg - success 0 matches
1000x1000_webbanner2.jpg - fail 1 match {1000}
2000 years ago_files.jpg - success 0 matches
626gamingassets_styleguide.jpg - success 0 matches
70707_Front010_0001_1.jpg - fail 2 matches{70707,0001}
I have a regex test to illustrate this at regex101.
The regex should only look for sets of underscore separated numbers at the beginning.