Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Email Parser

  Asked By: Bertha    Date: Sep 08    Category: Java    Views: 1078
  

I have a problem with parsing Email addresses in .html files with
Java.
In html we have tags for defing email addresses:

<p>This is my email
<a href=mailto:test@...>Mail Me</a>
<a href=mailto:tmp@...>Click Here</a>
</p>

"Mail Me" and "Click here" become hyperlinks to the email addresses.

I want to write a java program which can parse email addresses and
then it prints them in command window.

For simpilicity sake, the input (.html file) is written in the
program like this:


public static void main (String[] text)
{
String strInput = new String("This is my email .... <a href =
mailto:....");
}

I do appriciate if anybody can help me or anybody can give me its
algorithm;

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Eshe Chalthoum     Answered On: Sep 08

U can use regular expression in Java. search google for "regex in java" or
"email patterns in java  regular expression"

 
Answer #2    Answered By: Waggoner Fischer     Answered On: Sep 08

Do you something like a regular expression?
Can't you use for example "^mailto:.*\>$" or something like that to match
email patterns?

 
Answer #3    Answered By: Davi Costa     Answered On: Sep 08

If u need make use of this url as a reference. http://vipan.com/htdocs/javamail.html

 
Didn't find what you were looking for? Find more on Email Parser Or get search suggestion and latest updates.




Tagged: