java - how to identify dominating email patterns in a list -


is possible, e.g:

jon.smith@abc.com henry.smith@abc.com  brian.smith@abc.com jons@abc.com john@abc.comenter  

are email ids of 1 domain above e.g. pattern dominates first.last name.

is there way in excel or other way recognize dominating pattern list of emails? 1 company abc

if there ten domains 5 emails each, should able find 5 dominating formats these emails.

wondering if can me start off search , find way automate it.

it seems if using regular expressions categorize strings. uses regex match expressions containing literal dot (.) before @ sign. have modified code tutorialspoint fit email patterns.

import java.util.regex.matcher; import java.util.regex.pattern; public class regexmatches {     public static void main(string args[]){            // string scanned find pattern.           string[] emails = {"jon.smith@abc.com", "jonsmith@abc.com"};           string pattern = "\\w+[.]\\w+(?=@)";            // create pattern object           pattern r = pattern.compile(pattern);       (int i=0; i<emails.length; i++) {     // create matcher object.     string line = emails[i];     system.out.println(line);           matcher m = r.matcher(line);           if (m.find()) {              system.out.println("match");           } else {              system.out.println("no match");           }     }        }     } 

Comments