On 9/25/07, Paul McGuire wrote: > On Sep 24, 11:23 pm, Gabriel Genellina wrote: > > py> print re.sub(r"<(\w+)([^>]*)></\1>", r"<\1\2 />", source) > > And let's hope the OP doesn't have to parse anything truly nasty like: > > <esolang:language name="Python" interpreter_prompt=">>>"></ > esolang:language>
Or something mildly nasty, like <foo><foo/></foo> -Miles -- http://mail.python.org/mailman/listinfo/python-list