I am looking for a regex for use in php (possibly with preg replacement?) That breaks the text into all unclosed <and ONLY unclosed and all unopened >and ONLY closed ones.
Some examples:
1
<name> aaaaaa bbbbb < aagfetfe <aaaa/>
to
<name> aaaaaa bbbbb aagfetfe <aaaa/>
2
<<1111>sbab < amkka <pippo>
to
<1111>sbab amkka <pippo>
3
<1111> aaaa < thehehe > aaaaaa <ciao>
to
<1111> aaaa < thehehe > aaaaaa <ciao>
4
<1111> aaaa thehehe > aaaaaa <ciao>
to
<1111> aaaa thehehe aaaaaa <ciao>
5
<1111> aaaa thehehe < aaaaaa
to
<1111> aaaa thehehe aaaaaa
I really can't make it too complicated for me.
source
share