<%@ page contentType="text/html;charset=GBK" %>
<%@ page language="java" import="java.util.regex.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>表单验证</title>
</head>
<body>
<%
	String num = request.getParameter("num");
	String i = request.getParameter("int");
	String email = request.getParameter("email");
	boolean suc = true;
	if(!num.matches("^\\d+(\\.\\d+)*$")) {
		suc = false;
		out.print("<br>数字不合法");
	}
	
	if(!i.matches("^-?\\d+$")) {
		suc = false;
		out.print("<br>整数不合法");
	}
	
	if(!email.matches("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$")) {
		suc = false;
		out.print("<br>电子邮件不合法");
	}

	if(suc)out.print("<font color=\"red\">验证通过</font>");
%>
</body>
</html>