gistfile1.txt import java.util.Scanner;import java.util.regex.Matcher;import java.util.regex.Pattern;public class Emails {public static void main(String[] args) {Scanner scan = new Scanner(System.in);String inputStr = scan.nextLine();String
import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Emails { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String inputStr = scan.nextLine(); String mah = "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$"; Pattern pattern = Pattern.compile(mah); Matcher matcher = pattern.matcher(inputStr); boolean result = matcher.matches(); System.out.println(result); } }