Klaus Alexander Seistrup wrote: > Is there a way to "expand" simple regexps? Something along the > lines of: > > #v+ > > >>> rx = '(a|b)c?(d|f)' > >>> expand_regexp(rx) > ['ad', 'af', 'acd', 'acf', 'bd', 'bf', 'bcd', 'bcf'] > >>> > > #v- hint: import sre_parse print sre_parse.parse(rx) the rest is just a small matter of programming. </F>