Expanding regexps

Klaus Alexander Seistrup klaus at seistrup.dk
Tue Oct 28 02:31:32 EST 2003


Hi,

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-

Cheers,

  // Klaus

-- 
 ><> 	unselfish actions pay back better




More information about the Python-list mailing list