I usually use lxml to parse xml, but in this case, I just need to change the content of a single tag.
<sales_start_date>YYYY-MM-DD</sales_start_date>
YYYY-MM-DD is a variable date.
How would I replace the above to:
<sales_start_date>2013-01-01</sales_start_date>
Here is what I currently have (which sort of works)
re.sub('<sales_start_date>[\d-]+</sales_start_date>',
'<sales_start_date>2013-01-01</sales_start_date>',
data)
Since you know the exact tags, this is pretty simple, just grab any character until the next tag (any character not
<):