Message260216
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'
======================================================================== |
|
Date |
User |
Action |
Args |
2016-02-13 00:19:24 | Magesh Kumar | set | recipients:
+ Magesh Kumar, ezio.melotti, mrabarnett |
2016-02-13 00:19:24 | Magesh Kumar | set | messageid: <1455322764.68.0.816067707271.issue26354@psf.upfronthosting.co.za> |
2016-02-13 00:19:24 | Magesh Kumar | link | issue26354 messages |
2016-02-13 00:19:24 | Magesh Kumar | create | |
|