• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

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
0
anup001
Asked:
anup001
3 Solutions
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now