Michael Spencer wrote: > I have wrapped up my current understanding in the following class:
I see you assume that only \w+ can fit inside of a %() in a format string. The actual Python code allows anything up to the balanced closed parens. >>> class Show: ... def __getitem__(self, text): ... print "Want", repr(text) ... >>> "%(this(is)a.--test!)s" % Show() Want 'this(is)a.--test!' 'None' >>> I found this useful for a templating library I once wrote that allowed operations through a simple pipeline, like %(doc.text|reformat(68)|indent(4))s Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list