I have tried to get this working for most of the day. At this point I can't even remember what I have tried and what I haven't tried, so now I'm asking for help!
I'm going to be using php's preg_replace()
to delete stanzas out of svg code.
But the problem I am facing can be shown with this much simpler example:
<div>
TRUE
</div>
<div>
FALSE
</div>
<div>
MAYBE
</div>
How do I match the middle div? A simple version of my regular expression is
(?s)<div.*?FALSE.*?<\/div>
That doesn't work, as it will match the first 2 divs, instead of only the middle one.
(is it still called greedy when it expands the match to the left?)
All the variations I tried got me nowhere. I'm sure there is a simple answer, I just couldn't find it on my own.