巷尾的酒吧

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  64 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks
package org.abin.lee.basic.regex;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MyRegex {
public static boolean getResult(String future){
boolean result=false;
String regex="^[0-9a-zA-Z_]+@?[0-9a-zA-Z_]+.[a-zA-z]+$";
// String regex="^1(3[4-9]?|5[018-9]?|8[07-9]?)[0-9]{8}$";
Pattern pattern=Pattern.compile(regex);
Matcher matcher=pattern.matcher(future);
result=matcher.matches();
return result;
}
public static void main(String[] args) {
boolean flag=false;
String future="varyall@tom.com";
// String future="13588844873";
flag=getResult(future);
System.out.println("flag="+flag);
}
}
posted on 2012-10-12 11:12 abing 阅读(209) 评论(0)  编辑  收藏 所属分类: regex

只有注册用户登录后才能发表评论。


网站导航: