próbuję dostać e-maile z łańcucha, który jest podobny:znaleźć e-maile w ciągu znaków
"*** [email protected]&&^ [email protected]((& ";
private static Pattern p = Pattern.compile("(^[a-zA-Z0-9_.+-][email protected][a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$)");
Powyższy kod można dostać jeden email.
Jak mogę uzyskać wszystkie?
Można użyć klasy deseń w Javie [patrz tutaj] [1] [1]: http://stackoverflow.com/questions/7899116/extracting-names-and -mail-adres-z-string-z-regex – PSR
zobacz tutaj http://stackoverflow.com/questions/7899116/extracting-names-and-email-address-z--string-with-regex – PSR
Nie jestem pewien znak '+' jest dozwolony w wiadomościach e-mail. – sp00m