
Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3573 Modified Files: string.py Log Message: Make the regex pattern easier to read, understand, and modify by factoring out the common prefix (the delimiter). Index: string.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/string.py,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- string.py 18 Sep 2004 00:06:34 -0000 1.84 +++ string.py 26 Sep 2004 18:56:44 -0000 1.85 @@ -101,10 +101,12 @@ class _TemplateMetaclass(type): pattern = r""" - (?P<escaped>%(delim)s{2}) | # Escape sequence of two delimiters - %(delim)s(?P<named>%(id)s) | # delimiter and a Python identifier - %(delim)s{(?P<braced>%(id)s)} | # delimiter and a braced identifier - (?P<invalid>%(delim)s) # Other ill-formed delimiter exprs + %(delim)s(?: + (?P<escaped>%(delim)s) | # Escape sequence of two delimiters + (?P<named>%(id)s) | # delimiter and a Python identifier + {(?P<braced>%(id)s)} | # delimiter and a braced identifier + (?P<invalid>) # Other ill-formed delimiter exprs + ) """ def __init__(cls, name, bases, dct):
participants (1)
-
rhettingerīŧ users.sourceforge.net