I have an XML file with no double quotes to the attribute values. The following is a sample. As you can see, these are the possible values and I tried using the regex *=\s*([^" >]+)
and replace with ="\1"
which works for the most part but it has two issues.
Any help on these will be appreciated.
- It doesn't replaces the empty values (eg.status) with double quotes("").
- It replaces the first word only when the value has a sentence.eg(description)
Sample input:
<tool id=2 code=abc description=my description end here my_levels=$15,000/$30,000 individual_level= amount=0 status= my_code=P my_date=2017-02-21T00:00:00 points= />
expected result:
<tool id="2" code="123abc" description="my description end here" my_levels="$15,000/$30,000" individual_level="" amount="0" status="" my_code="P" my_date="2017-02-21T00:00:00" points="" />