From: David A. <da...@bo...> - 2004-04-17 13:47:09
|
Dave G. recently expressed some concern about the nested markup patch, since he discovered that there's an internal limit on regex groups: >>> re.compile('(.)'*500) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.3/sre.py", line 179, in compile return _compile(pattern, flags) File "/usr/local/lib/python2.3/sre.py", line 227, in _compile p = sre_compile.compile(pattern, flags) File "/usr/local/lib/python2.3/sre_compile.py", line 474, in compile assert p.pattern.groups <= 100,\ AssertionError: sorry, but this version only supports 100 named groups I just did some little experiments and it appears that the limits on named groups won't be a problem for the nested markup patch, because we can use a fixed number of named groups and use unnamed groups for the rest: >>> re.compile('(?:.)'*500) <_sre.SRE_Pattern object at 0xa154450> -- Dave Abrahams Boost Consulting http://www.boost-consulting.com |