Need a solution here. Working in PHP, but I can switch to a different language if it will help me solve this problem (i.e. a java function, for example...) I need to parse a block of text and remove parts of it. I have this block of text:
<!-- START EXAMPLE TEXT -->
other text
blach blah blah
some < HTML > tag
< TABLE width=640 >
< TR >
< FORM action="test.cgi" >
< /tr >
< / table >
blah blah
welcome to my website
<!-- END EXAMPLE TEXT -->
What I basically need, is to remove everything from "< TABLE..." all the way down to "...action=", and then remove the "< /tr >" and the "< /table >". Also, I can't touch any of the text around it.
The problem: I have tried preg_replace, ereg_replace, str_replace...everything. When I do just this:
ereg_replace("< TABLE width=640 >", "", $raw_content);
that works fine.
BUT, when I try to do MORE than one line, i.e.:
ereg_replace("< TABLE width=640 >
< TR >
< FORM action=", "", $raw_content);
that just doesn't work. No way no how. Any ideas?
Thanks in advance!