<%@ page contentType="text/html;charset=GBK" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>验证字符串中包含有效字符结果</title>
</head>
<body>
<%
	String txt = request.getParameter("txt");
	if(txt==null || txt=="") {
		out.print("不能空");
		return;
	}
	String []keyword = new String[]{
				"[0-9]+", "BS", "RPWT", "YY"
				};
	for(int i=0; i<keyword.length; i++) {
		if(txt.matches(keyword[i]) || txt.indexOf(keyword[i])!=-1) {
			out.print("验证通过");
			return;
		}
	}
	
	out.print("不包含有效字符");
%>
</body>
</html>