I need an expression to put into either a eregi_replace or a ereg_replace function that finds 'something' with an unknown 'extra' after it and ending at a 'known end'.
ex:
I want to find something like this:
"<TAG ... extra stuff in middle ... </TAG>"
And replace with null. note that the end greaterthan is not present on the begging of the tag. This is because sometimes the tag itself might have attributes inside the tag. So I need to include all that content as well for replacing.
I tried this which works in OTHER languages (java based), but does not work in PHP:
$adjusted_data = eregi_replace(/<tag[>]>[\s\S]<\/tag[>]>\n/,'',$orig_data);
Please, anyone care to get this working for me? I poured through some regex pages but am still lost how to get this ... seemlingly simple expression to work 🙁
PS: before you feel like responding with "why dont you use strip_tags()?"... don't.