phone numebrs and emails

Hello experts,

If I ahve a way to create a web crwaler in java to coillect and browse thru urls beginning at a particular page,, is there a way using regualr expression to find out contact information such as emails phones zip codes address from contacus pages of the websites that we are crawling?

Any lnks or tutorials would be much appreciated.

Thanks
A001
anup001Asked:
Who is Participating?
 
radarshCommented:
Try http://www.regular-expressions.info

There is an example on an Email Validation RegEx. It might be helpful. Now, phone numbers,
it depends on the format you are using... If you post the format, I can help you with the
RegEx.

________
radarsh
0
 
anup001Author Commented:
i think we will use the regular format XXX-XXX-XXXX or (xxx)-XXX-xxxx

I know the use of regualr expressions but i meant to ask what would be the exact way of extracting such information from a crawler like thing.

Thanks
A001
0
 
ksivananthCommented:
for the ph. no. the pattern will be as follow as,

"(*[0-9][0-9][0-9])*-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]". May be sombody write a simpler one :)
0
 
WebstormCommented:
phone numbers
   "([0-9]{3}|\\([0-9]{3}\\))-[0-9]{3}-[0-9]{4}"
if the number of digits can vary :
   "([0-9]+|\\([0-9]+\\))-[0-9]+-[0-9]+"

for email addresses :
   "[A-Za-z_.0-9]+@[A-Za-z_.0-9]+(\\.[A-Za-z_.0-9]+)+"

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.