Regular Expression Preg_replace problem
Posted: Wed Dec 22, 2004 3:14 am
Good day All,
i am using this code to remove all links to the specified pages in the page showing to the user. first i start output buffering and then i do a preg_replace, when i try removing just the link it works fine. But i also need sometimes to remove the surronding Table row, to get rid of the borders & wasted space. This is for use in a show/hide module. the code is:
the new trial -removing td and tr tags - is:
the result is an empty page!
Please advice, thank you very much in advance
i am using this code to remove all links to the specified pages in the page showing to the user. first i start output buffering and then i do a preg_replace, when i try removing just the link it works fine. But i also need sometimes to remove the surronding Table row, to get rid of the borders & wasted space. This is for use in a show/hide module. the code is:
Code: Select all
// names of php files seperated by '|' with no '.php'
$pages = "StockTransfers|ReverseGRN";
$buffer= preg_replace("<їaA]s?.*sїhH]їrR]їeE]їfF]=ї"']?.*(".$pages.").*ї"']?s*.*ї^(/a)]+/a>","dummy",$buffer);
return $buffer;Code: Select all
$pages = "StockTransfers|ReverseGRN|SelectOrderItems";
$buffer= preg_replace("(<їtT]їrR]\sї^>]*>ї\s]*<їtT]їdD]\sї^>]*>)?<їaA]\s?.*\sїhH]їrR]їeE]їfF]=ї"'']?.*(".$pages.").*ї"'']?\s*.*ї^(\/a)]+/a>(</їtT]їdD]>ї\s]*</їtT]їrR]>)?","dummy",$buffer);Please advice, thank you very much in advance