Chinaunix

标题: java验证邮箱地址的正则表达式怎么写 [打印本页]

作者: herrapfel    时间: 2011-03-08 14:04
标题: java验证邮箱地址的正则表达式怎么写
boolean isMatch = mailAddress.matches("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+!d");

这么写无法匹配到

aaa@qddd.com.cn

的地址啊

要能匹配到 .com  ,.cn .com.cn的

谢谢了
作者: herrapfel    时间: 2011-03-08 15:49
自己顶,谁来帮忙解决下啊




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2