def invert(regex):
invReGenerator = GroupEmitter(parser().parseString(regex)).makeGenerator()<EOL>return invReGenerator()<EOL>
r"""Call this routine as a generator to return all the strings that
       match the input regular expression.
           for s in invert(r"[A-Z]{3}\d{3}"):
               print s