En Tue, 25 Sep 2007 18:21:08 -0300, Robert Dailey <[EMAIL PROTECTED]>  
escribi�:

> One thing I noticed is that it is placing an arbitrary space between "  
> and
> />. For example:
>
>
> <root><frame type="image" /></root>
>
> Notice that there's a space between "image" and /></root>

Just remove the space in the replacement string:

>> py> print re.sub(r"<(\w+)([^>]*)></\1>", r"<\1\2 />", source)
                                                    ^
                                                    |

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to