in my C# Application im trying to delete some of my XML Elements by filtering them out with a regular expression.
My Input is for example:
<myXMLTag id="Text1.Text2.Text3">
<Anything/>
</myXMLTag>
<myXMLTag id="Text1.ISHOULDNOTBEHERE.Text3">
<Anything/>
</myXMLTag>
<myXMLTag id="Text1.Text2.Text3">
<Anything/>
</myXMLTag>
I tried some regular Expressions on http://regexstorm.net/tester but it somehow always marks the first two <myXMLTag>
and not just the middle one.
Pattern:
<myXMLTag.*Text1.+(ISHOULDNOTBEHERE)+.*?</(myXMLTag)>
I need a pattern, that only finds XML Elements in a XML string, which look like the middle one.