JimmySeraph
package org.jimmy.studyproject.test;

import java.util.regex.Pattern;

public class Reg20200608 {

    public static Pattern pattern = Pattern.compile("[a-zA-Z]([a-zA-Z]|[.])*@[a-zA-Z]+([.][a-zA-Z]+)+");
    
    public static void main(String[] args) {
        String email = "fgf.fg@dft.com";
        System.out.println(pattern.matcher(email).matches());
        email = "fgf.fg@dft.com.cn";
        System.out.println(pattern.matcher(email).matches());
        email = "fgffg@dft.com";
        System.out.println(pattern.matcher(email).matches());
        email = "fgffg@dft.com.cn";
        System.out.println(pattern.matcher(email).matches());
        email = ".fgffg@dft.com";
        System.out.println(pattern.matcher(email).matches());
    }

}

好了

分类:

技术点:

相关文章:

  • 2022-01-18
  • 2022-12-23
  • 2021-10-03
  • 2021-06-04
  • 2021-10-06
  • 2021-08-01
猜你喜欢
  • 2021-11-16
  • 2021-11-21
  • 2022-01-07
  • 2022-01-19
  • 2022-02-09
  • 2022-01-08
  • 2021-12-20
相关资源
相似解决方案