I am trying to create a number range given a regex. This is the opposite of most questions in trying to validate if a number is in a range. I am going to be given the regex and need to create the range.
For example, given the regex "80055510[34]X" I would like to create the numbers 8005551030 through 8005551049. The "X" can be whatever, it's just what the end users are used to using (in Cisco Call Manager applications).
Given "80055512[12][12]" it would create:
8005551211 8005551212 8005551221 8005551212
Given: "800555120[0-2,9]" it would generate:
8005551200 8005551201 8005551202 8005551209
Is this possible using regular expressions or do I just need to parse things on my own and do it?
I would be coding this in Java if it makes a difference. Thanks.