Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

regex to find email address from a String

Tags:

My intention is to get email address from a web page. I have the page source. I am reading the page source line by line. Now I want to get email address from the current line I am reading. This current line may or may not have email. I saw a lot of regexp examples. But most of them are for validating email address. I want to get the email address from a page source not validate. It should work as http://emailx.discoveryvip.com/ is working

Some examples input lines are :

1)<p>Send details to <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;%72%65%62%65%6b%61%68@%68%61%63%6b%73%75%72%66%65%72.%63%6f%6d">[email protected]</a></p>

2)<p>Interested should send details directly to <a href="http://www.abcdef.com/abcdef/">www.abcdef.com/abcdef/</a>. Should you have any questions, please email <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;%6a%6f%62%73@%72%65%6c%61%79.%65%64%75">[email protected]</a>.

3)Note :- Send your queries at  [email protected]  for more details call Mr. neeraj 012345678901.

I want to get [email protected] from examples 1,2 and 3. I am using java and I am not good in rexexp. Help me.