// URL that generated this code:
// http://www.txt2re.com/index-java.php3?s=%22Robert%20Donhan%22%20%3Cbob@email.com%3E&3
import java.util.regex.*;
class Main
{
public static void main(String[] args)
{
String txt="\"Robert Donhan\" <bob@email.com>";
String re1=".*?"; // Non-greedy match on filler
String re2="([\\w-+]+(?:\\.[\\w-+]+)*@(?:[\\w-]+\\.)+[a-zA-Z]{2,7})"; // Email Address 1
Pattern p = Pattern.compile(re1+re2,Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
Matcher m = p.matcher(txt);
if (m.find())
{
String email1=m.group(1);
System.out.print("("+email1.toString()+")"+"\n");
}
}
}
//-----
// This code is for use with Sun's Java VM - see http://java.sun.com/ for downloads.
//
// Paste the code into a new java application or a file called 'Main.java'
//
// Compile and run in Unix using:
// # javac Main.java
// # java Main
//
 
Feedback
ShubhamGupta::
Saved my day!
Wed, 29 May 2013 11:36PM
::
Thu, 30 May 2013 12:02AM
Astarte::
Awesome, just awesome!
Thu, 30 May 2013 12:03AM
David Dawkins::
Excellent tool, where's the donate link? thank-you !!!