I have a long list of regular expressions that should be tested. Instead of walking through the list one by one and writing an applicable test for each expression - if possible - I want to create a generator function that will consider the type of regular expression and generate relevant input string.
For example:
rgx = re.compile(r'^item_(?P<item_number>\d+)$')
Is it possible to determine the type of input that a regex would match? Considering the above example, is it possible to determine the input (such as item_23567) that the regex needs from the compiled regular expression?