Barton David wrote:
> I don't suppose there's a nifty trick (exploiting the internal workings
> of the re module perhaps) to generate all possible hits of a given regex
> pattern?
>
> Something like:
>
>> >> import re
>> >> mypattern=re.compile( "[AB]C{1,2}D?" )
>> >> print list( all_pattern_
I don't suppose there's a nifty trick (exploiting the internal workings
of the re module perhaps) to generate all possible hits of a given regex
pattern?
Something like:
>>> import re
>>> mypattern=re.compile( "[AB]C{1,2}D?" )
>>> print list( all_pattern_generator( mypattern ) )
["AC","BC","ACC