public static boolean checkEmail(String inputStr) {
if (inputStr == null || inputStr.equals("")) {
return false;
}else if (!inputStr.matches("^([a-z0-9A-Z]?+[_-|\\.]?)+([a-z0-9A- Z]?)@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$")) {
return false;
} else {
return true;
}
}
if (inputStr == null || inputStr.equals("")) {
return false;
}else if (!inputStr.matches("^([a-z0-9A-Z]?+[_-|\\.]?)+([a-z0-9A- Z]?)@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$")) {
return false;
} else {
return true;
}
}
解决方案 »
- The requested resource (/webtest/servlet/hello.html) is not availabl 帮忙解决
- jsp文件运行不了,求教
- Groovy 到底比java好在哪儿?
- Javascript中取textfield值的问题
- 求助!急!jsp中静态包含include中文问题
- 请教:JSP中的中文 在SCO UNIX 下显示乱码,不知道怎搞了??
- 在java中怎么读写dbf文件,怎么我按照dbf格式读出的数据是一些-128到+128的整数!??请教高手!
- 两个礼拜搞定jsp
- 在Win2000开发 JSP程序能否轻易移植到Linux?
- 谁有用Jsp做统计图的方法?
- web.xml配置问题
- 怎样把下拉框选中的值传递到另一个页面上
var at=email.indexOf("@");
var point=email.indexOf(".");if(at<0){处理一下....
反回..}
if(point<at){
处理一下....
}
java 类也可以用indexOf()这个函数