Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String regex="\b([a-zA-Z-0-9_])+@([a-zA-Z-0-9_\\.]+)+\b";
- StringBuilder domains=new StringBuilder();
- Scanner scanner=new Scanner(System.in);
- Integer lines =Integer.parseInt(scanner.nextLine());
- for (int i = 0; i < lines; i++) {
- String str =scanner.nextLine();
- Matcher match= Pattern.compile(regex).matcher(str);
- if (match.find()){
- for (int j=match.start();j<=match.end();j++)
- domains.append(str.charAt(j));
- domains.append(';');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment