Regex to match number(s) or UUID

Viewed 13373

I need regex which loosely matches UUIDs and numbers. I expect my filename to be formatted like:

results_SOMETHING.csv

This something ideally should be numbers (count of how many time a script is run) or a UUID.

This regex is encompasses a huge set of filenames:

 ^results_?.*.csv$

and this one:

 ^results_?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}.csv$

matches only UUIDs. I want a regex whose range is somewhere in between. Mostly I don't want matches like result__123.csv.

2 Answers
Related