I have this XML-structure where I would like to match the individual data-elements elements that have the ###DoNotUse###
string inside.
In the example, it should match the data elements C
and E
.
But my RegEx also matches all data-elements before the matches that I require, meaning A+B+C
instead of just C
, and D+E
instead of just E
.
I appreciate your help very much.
My RegEx is:
<data(.*?)###DoNotUse###(.*?)</data>
The example data is:
<data name="A">
<value>A</value>
<comment>Bla Bla</comment>
</data>
<data name="B">
<value>B</value>
</data>
<data name="C">
<value>###DoNotUse###</value>
<comment>Bla Bla</comment>
</data>
<data name="D">
<value>D</value>
<comment>Bla Bla</comment>
</data>
<data name="E">
<value>###DoNotUse###</value>
</data>