Regular Expressions: Can't quite figure this problem out
rcdailey at gmail.com
Tue Sep 25 02:37:20 CEST 2007
I'm attempting to create a regular expression that removes redundancy in
empty XML elements. For example:
The regular expression would convert the XML above into:
And another complex example:
So far I've been unsuccessful in creating a regular expression to do this.
Below are outlined various guarantees:
- The XML to be parsed shall have NO comments in it
- The XML to be parsed shall have NO whitespace (spaces, tabs, carriage
returns, etc) between elements. The examples above represent what this
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list