JohnB 255 Posted March 13, 2011 Report Share Posted March 13, 2011 Here is a regex string that will match most variations of phone numbers in the North American format: \(?\b[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}\b It matches 1112223333, 111.222.3333, 111-222-3333, 111 222 3333, (111) 222 3333 and all combinations thereof. John Quote Link to post Share on other sites
Mediadealer 1 Posted March 14, 2011 Report Share Posted March 14, 2011 i'm trying to get this to work using your 'email scraping bot'and just replacing the reg-ex for email with the one above for phone numbers. the problem is when i run the bot on a given page it grabs all the text on the pagenot just the phone number. ever run into this before? would love some help!--Corey Quote Link to post Share on other sites
JohnB 255 Posted March 14, 2011 Author Report Share Posted March 14, 2011 Can you provide an example page and I will put together some code to show you how to use it? John Quote Link to post Share on other sites
Mediadealer 1 Posted March 14, 2011 Report Share Posted March 14, 2011 well so far i've actually been scraping out of gmail. but one of the emails with a phone number i foundi've exported as html and uploaded: http://mytrueresults.org/phone.html let me know if that's helpful... --Corey Quote Link to post Share on other sites
JohnB 255 Posted March 14, 2011 Author Report Share Posted March 14, 2011 This particular scrape didn't need regex...it's a straightforward wildcard scrape (thanks to unique tags) scrape phone.ubot John Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.