I have a xml file, and I have to match the char < and > inside the tag and replace them, but I have some difficulties catching them...
The xml is something link this:
<tag>text</tag>
<tag2>3 is > than 2</tag2>
<tag3>But 1 in < than 4</tag3>
I found a solution using this regex
(\s>\s|\s<\s)
including a whitespace, the character and another whitespace... but how if there aren't the whitespaces?
Edit In fact I need to replace these symbols with <
and >
...
The xml fields are obtained from a third party software that gave away the output xml file like the one I've written above.
I know that the best approach is that when the software reads the data it encodes the < and > as <
and >
in the xml, but I hoped that there was a way to do it afterwards