java - how do I split email from a String -


i have string "test test <test@test.com>" need split email address if string present in format or else no need spilt. have not got solutions show approach.

i need split email address if present in above mentioned format.

you can extract email this.

import java.util.regex.matcher; import java.util.regex.pattern;  public class helloworld {      public static void main( string[] args ) {         string mydata ="test test <test@test.com>";         pattern pattern = pattern.compile(".*<(.*)>");         matcher matcher = pattern.matcher(mydata);          string email = null;         if (matcher.find())         {             email = matcher.group(1);          }          system.out.println(email);     } } 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -