Generating a list of values a regex COULD match in Python
- by mlissner
I'm trying to use a regex as an input, and from there generate all the possible values that the regex would match.
So, for example, if the regex is "three-letter words starting with a, and ending in c," then the code would generate a list with the values [aac, abc, acc, adc, a1c....].
Is there an easy way to do this? I'm using python.