I have two possible cases in some XML.
Case 1, incorrect: <tag att1="text1"/>
Case 2, correct: <tag att1="text1" att2="text2"/>
So I am trying to find all examples of <tag att1="text1"/>
to add attribute 2.
I want to find all my examples of case 1 and add the string for case 2.
<tag att1="(.*?)"/>
find both case 1 and case 2
find
<tag att1="(.*?)"(?! att2="(.*?)"/>)
is failing because att1=(.*?) because it still selects att2
<tag att1=(".*?")(?! att2=".*?"/>)
is failing because att1=(.*?) because it still selects att2
How do I prevent my search from finding my case 2 xml?
1