求正则表达式过滤<script>、<link>
<!DOCTYPE html>
<html xmlns:html="http://www.w3.org/TR/WD-xsl" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns="http://schemas.microsoft.com/intellisense/ie5">
<head>
<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css"/>
<link rel="stylesheet" type="text/css" href="http://stylesheets/relatedlinks.css"/>
<link rel="stylesheet" type="text/css" href="http://includes/client/msgbox/msgbox.css"/>
<link rel="stylesheet" type="text/css" href="http://stylesheets/shared.css"/>
<SCRIPT LANGUAGE="javascript" defer="defer" src="http://includes/client/msgbox/modalbox.js"><!---->
</SCRIPT>
<script type="text/javascript">
function DoWatchList()
{
vtbl=document.getElementById('xxxx');
}
</script>
</head>
<body>
OK
</body>
</html>
过滤html 正则表达式过滤 字符串过滤脚本样式
<!DOCTYPE html>
<html xmlns:html="http://www.w3.org/TR/WD-xsl" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns="http://schemas.microsoft.com/intellisense/ie5">
<head>
</head>
<body>
OK
</body>
</html>
(?isx)
<
(?>
(?'open'script[^>]*>)
[解决办法]
(?'-open'</script)
[解决办法]
(?:(?!</script).)*
)*
(?(open)(?!))
>
[解决办法]
<link\s*rel="stylesheet"[^>]*>