in reply to Expanding reg expression.

I think Regexp::Genex will do what you want.

Btw [001-004] in a regex don't match '001'; in fact that "regex" produces <c>Invalid [] range "1-0" in regex