巷尾的酒吧

            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 閱讀(223) 評論(0)  編輯  收藏 所屬分類: regex
          主站蜘蛛池模板: 法库县| 凭祥市| 景德镇市| 迁安市| 蒙山县| 商城县| 秀山| 宾阳县| 陆河县| 大丰市| 墨竹工卡县| 镇安县| 内乡县| 乌兰浩特市| 福泉市| 承德县| 宜丰县| 芦山县| 林州市| 乌鲁木齐县| 平武县| 珠海市| 庄浪县| 隆林| 大埔区| 庆阳市| 教育| 巨鹿县| 颍上县| 阜新| 依安县| 屯留县| 泸水县| 台山市| 沭阳县| 栖霞市| 西和县| 墨江| 重庆市| 定兴县| 大庆市|