标签:bsp 匹配 校验 http stat 相对 reg class check
//https://baike.baidu.com/item/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/1700215?fr=aladdin
public class Mylearn_2 { public static void main(String[] args) { checkMail(); } public static void checkMail() { // 需求: 对邮件地址进行校验 String mail = "abc123@sina.com"; String reg = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+"; // 较为精确的匹配 reg = "\\w+@\\w+(\\.\\w+)+"; //相对不太精确的匹配 System.out.println(mail.matches(reg)); } }
标签:bsp 匹配 校验 http stat 相对 reg class check
原文地址:https://www.cnblogs.com/zxl1010/p/11905902.html