Regex spiffification: baby steps

By Filip Salo; published on September 19, 2006.

So here's the first few steps:

>>> import spiffyre as re
>>> a = re.compile(r"a*b")
>>> b = re.compile(r"c|d")
>>> a
<Regex object for 'a*b'>
>>> b
<Regex object for 'c|d'>
>>> a + b
<Regex object for '(?:a*b)(?:c|d)'>
>>> a | b
<Regex object for '(?:a*b)|(?:c|d)'>
>>> (a + b).findall("abcbadcbd")
['abc', 'bd']

Spiffier, but not spiffy enough. Next up: obstacles.