国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

用java實現簡單的email正則表達式判斷

2019-11-18 13:39:43
字體:
來源:轉載
供稿:網友

  import java.sql.*;
import java.io.*;
import java.util.regex.*;

public class test{
public static void main(String[] args){
try{
String s = "";
while(!s.equals("q")){
System.out.PRint("input:");
DataInputStream in = new DataInputStream(new BufferedInputStream(System.in));
s = in.readLine();
System.out.println("your input is :"+s);
String check = "^([a-z0-9A-Z]+[-//.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?//.)+[a-zA-Z]{2,}$";
Pattern regex = Pattern.compile(check);
Matcher matcher = regex.matcher(s);
boolean isMatched = matcher.matches();
if(isMatched){
System.out.println("it's a email");
}else{
System.out.println("it's not a email");
}

}
}catch(Exception e){
System.out.println("error"+e.getMessage());
}
}
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 凤山县| 蒙山县| 平安县| 奉化市| 铜梁县| 彩票| 苏尼特左旗| 泸西县| 呼玛县| 三亚市| 华蓥市| 吉水县| 黄陵县| 邹平县| 西丰县| 新邵县| 桂东县| 宜良县| 浦城县| 沙洋县| 腾冲县| 和平区| 曲周县| 岳池县| 平武县| 龙山县| 临城县| 乐至县| 常山县| 崇阳县| 博白县| 华宁县| 迁西县| 东乌珠穆沁旗| 仁寿县| 罗甸县| 绍兴市| 永宁县| 泰顺县| 普定县| 海门市|