巷尾的酒吧

            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
          主站蜘蛛池模板: 陇川县| 新营市| 天气| 湛江市| 英德市| 林西县| 西盟| 兴化市| 仁化县| 寻甸| 黑龙江省| 随州市| 晋宁县| 若羌县| 新野县| 彝良县| 灵丘县| 河东区| 祁门县| 莱芜市| 呼伦贝尔市| 宁陕县| 鹤山市| 朝阳县| 油尖旺区| 永昌县| 新野县| 河北省| 会理县| 修水县| 平山县| 宜丰县| 轮台县| 衡南县| 上栗县| 平度市| 卫辉市| 富平县| 舒兰市| 依安县| 尚志市|