I am come up with a regex to grab all text between 2 HTML tags. This is what I have so far:
<TAG[^>]*>(.*?)</TAG>
In practice, this should work perfectly. But executing it in PHP preg_replace with options: /ims results in the WHOLE string getting matched.
If I remove the /s tag, it works perfectly but the tags have newlines between them. Is there a better way on approaching this?