This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Magesh Kumar
Recipients Magesh Kumar, ezio.melotti, mrabarnett
Date 2016-02-13.00:19:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455322764.68.0.816067707271.issue26354@psf.upfronthosting.co.za>
In-reply-to
Content
I am in the process of re.sub the tag <item type="dict"> </item> with empty string from a xml output line.

If "re.I" is used, I am not able to remove the complete tag. 

========================================================================
>>> a
'ype="str">false</latency_statistics_enabled><name type="str">Default</name><aggregates type="list"><item type="dict"><aggregate type="list"><item type="dict"><type type="str">MulticastClient</item><is'

>>> b = re.sub('\<\/?item(\s+type="dict")?\>', '', a, re.I)
>>> b
'ype="str">false</latency_statistics_enabled><name type="str">Default</name><aggregates type="list"><aggregate type="list"><type type="str">MulticastClient</item><is'
>>> b = re.sub('\<\/?item(\s+type="dict")?\>', '', a)
>>> b
'ype="str">false</latency_statistics_enabled><name type="str">Default</name><aggregates type="list"><aggregate type="list"><type type="str">MulticastClient<is'

========================================================================
History
Date User Action Args
2016-02-13 00:19:24Magesh Kumarsetrecipients: + Magesh Kumar, ezio.melotti, mrabarnett
2016-02-13 00:19:24Magesh Kumarsetmessageid: <1455322764.68.0.816067707271.issue26354@psf.upfronthosting.co.za>
2016-02-13 00:19:24Magesh Kumarlinkissue26354 messages
2016-02-13 00:19:24Magesh Kumarcreate