13次作业

import java.util.*;
public class zuoye12 {


            public static void main(String[] args) {
                // TODO Auto-generated method stub
                String regex = "\\w+[@]\\w+[.][comn]+[.]*[comn]*";
                System.out.println("请输入邮箱");
                Scanner reader = new Scanner(System.in);
                String s1 = reader.next();
                if(s1.matches(regex)) {
                    System.out.println("邮箱合法");
                }
                else {
                    System.out.println("邮箱不合法");
                }

            }

        
    }

 


 

posted on 2019-11-24 22:37  张九川  阅读(127)  评论(0编辑  收藏  举报

导航