I’m looking for a regex expression that will add an attribute to an element which already has a attribute with a particular value.
for e.g:
<meta name="stack" />
I want to add an attribute to the meta element which has an attribute name=”stack” such that it will look like
<meta name="stack" value="overflow" />
Also some C# code for match and replace will help.
I cannot use XmlDocument or HtmlAgilityPack due to malformed xml in input.
Thanks.
replace with