Originally posted by Mark Thompson
Clovertechies,
I have an XML fragment like:
<fieldname attr1="value1" attr2="value2" attr3="value3"/>
I would like to use regsub to update the value of one of the attributes "value2" to "newvalue".
I can isolate the portion to replace with a search pattern like:
{<fieldname.*?attr2="(.*?)"}
but I can't figure out how to get regsub to replace only the submatch (the portion inside the parenthesis). I would like my final output to be:
<fieldname attr1="value1" attr2="newvalue" attr3="value3"/>
Any suggestions?