I want to match the NEXT occurrence of '/</\g>/'
after every '/<g>/'
.
I'm trying to use this in a PHP preg_replace
to remove any group tags <g>
that have no id. I cannot select every closing group tag because I'm not removing all group tags.
For example:
<g id="someid">
<g>
<!--content-->
</g>
</g>
In the above example, the opening group tag needs to be kept, and so does the last </g>
that will close the opening tag. The group tag (opening and close) in between needs to go, but not the content inside it.