On my machine the program finishes in 30 seconds. (it's a 1.5GHz machine) If the 'parm' group is removed, or if the buffer is shortened, the time is reduced considerably.
There are "pathological cases" for regular expressions which can take quite a long time. In the case of your expression, it's happening for the group 'parm'. I think, but don't know, that each time a candidate for 'parm' is found, the following '#' (or maybe the second '<'?) is not found, and it backtracks to try to match 'parm' in a different way, which involves considering many different combinations (basically, each 'name=' could be the start of a new instance of the first parenthsized subgroup of <parm>, or it could be part of the character class that includes [a-zA-Z=]) You may wish to consider using other approaches for parsing this text than regular expressions. Jeff
pgpKO1Ax9UfsJ.pgp
Description: PGP signature
-- http://mail.python.org/mailman/listinfo/python-list