刘建广

博客园 首页 联系 订阅 管理

2012年4月27日

摘要: public boolean isJudgeEmail(String dateString){String eL="^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; Pattern p = Pattern.compile(eL); Matcher m = p.matcher(dateString); boolean b = m.matches(); return b;} 阅读全文
posted @ 2012-04-27 10:45 刘建广 阅读(206) 评论(0) 推荐(0)

摘要: 切记,只能在java中使用,支持 yyyy-MM-dd、yyy-MM-dd、yy-MM-dd 和 y-MM-dd ,范围 1~9999 年public boolean isJudgeDate(String dateString){String eL = "(?:[0-9]{1,4}(?<!^0?0?0?0))-(?:0?[1-9]|1[0-2])-(?:0?[1-9]|1[0-9]|2[0-8]|(?:(?<=-(?:0?[13578]|1[02])-)(?:29|3[01]))|(?:(?<=-(?:0?[469]|11)-)(?:29|30))|(?:(?< 阅读全文
posted @ 2012-04-27 10:27 刘建广 阅读(256) 评论(0) 推荐(0)