REGEX question.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wren9
Forum Newbie
Posts: 9
Joined: Sat May 23, 2009 1:50 am

REGEX question.

Post by wren9 »

Hi guys

I want to scrape emails addresses in my own website.
http://czone01.com/

using REGEX while i'm formulating my own REGEX.
Please i dont need DOM this time i only need REGEX.

Please assume that these email addresses will change someday.


Thank you in advance,


-warren
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: REGEX question.

Post by mikemike »

That's not really a question, thats you asking someone to do your work for them :P
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: REGEX question.

Post by jayshields »

Here is a starting point:

Code: Select all

^
[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*                                 # the username part
@[a-zA-Z0-9-]+                                                            # hostname
(.[a-zA-Z0-9-]+)*.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))   #TLD
$
Taken from the samples at http://www.cuneytyilmaz.com/prog/jrx/
Post Reply