最新邮箱匹配正则(邮箱前缀可包含"_")
2015-11-19 15:03
387 查看
/** * 校验邮箱格式 * * @param email * @return * @author shijing * 2015年11月10日下午6:17:59 */ public static boolean checkEmail(String email) { String check = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$"; Pattern regex = Pattern.compile(check); Matcher matcher = regex.matcher(email); return matcher.matches(); } public static void main(String[] args) { System.out.println(checkEmail("855485_wq@qq.com")); }
测试通过,后缀加下划线是不允许的。
相关文章推荐
- 在RedHat系统上安装JDK与Tomcat的步骤
- 黑马程序员日记-13
- android从零单排之百度地图的调用
- VisualStudio2010配置OpenCV的一种一劳永逸的方法
- php+mysql+pdo连接数据库
- 自动扫描和暴力破解
- ASP.NET MVC下判断用户登录和授权状态方法
- Composite(组合)设计模式
- 15-11-19 Eclipse 快捷键及各种设置
- Python基础(函数)
- 集合框架-----Vector中的枚举
- 关于NSURLSession之NSURLSessionConfiguration
- ubuntu下Django的安装和使用(一)
- win server 2008服务器System.outofmemory.exception解决方法
- ZooKeeper典型应用场景
- kphp开源框架分享:网站开发之前台css浏览器兼容方法!
- JS实现在文本框输入时自动弹出相关内容提示
- run as android application过程
- FB的编译报错问题
- 让select框中option无法选择