题解 | #邮箱验证#

邮箱验证

http://www.nowcoder.com/practice/8f908eeee4aa412ca88304f0acbaa1f9

这个函数有点方便哦
        String str = scanner.next();
        String emailMatcher="[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9]+";  //不明觉厉
        if(str.matches(emailMatcher))
            System.out.println("邮箱格式合法");
        else
            System.out.println("邮箱格式不合法");


全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务