Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
So I am trying to find everything that is inside of the table tags ans get rid of it.<tr> <td colspan=3> <table border="0" cellspacing="0" cellpadding +="2" bgcolor="#ffffff"> <tr> <td width="100%" align="left"><strong> <a href='http://www.webtesting.com/cgi-b +in/test.cgi> <!--&user=default --><!--a href='test.pl +?&user=default&theme=default' --> <font size="2"><small>Click here to mak +e this your default!</small></font></a> </strong></td> </tr> </table> <form> <input type="button" name="Submit" onClick +="top.opener.location.reload(1); top.close()" value="GO!" style="font +:9pt arial; background:silver"></p> </form> </td> </tr> </table> </body> </html>
Thanks!!!open(FILE, "$text_file") || print "Can't open output file1: $text_file +\n"; while(<FILE>) { if ($_=~/<table>(.*)<\/table>/sg) {$_=~s/<table>(.*)<\/table>//s +g;} $save=$save.$_; } my $file2 = "search_test2.txt"; open(DATA_OUT, ">$file2") || print "Can't open output file1: $file2\n +"; print DATA_OUT $save; close FILE; print $save;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expression
by Ovid (Cardinal) on Jan 02, 2003 at 16:49 UTC | |
|
Re: Regular Expression
by davorg (Chancellor) on Jan 02, 2003 at 16:45 UTC | |
|
(jeffa) Re: Regular Expression
by jeffa (Bishop) on Jan 02, 2003 at 16:47 UTC |