Dec 17, 2004 #1 peacecodotnet Programmer Joined May 17, 2004 Messages 123 Location US i'm looking for a preg_match_all pattern that would return a nice array of all email addresses in a string thanks! Peace out, Peace Co.
i'm looking for a preg_match_all pattern that would return a nice array of all email addresses in a string thanks! Peace out, Peace Co.
Dec 18, 2004 #2 vbkris Programmer Joined Jan 20, 2003 Messages 5,994 Location IN >> all email addresses where do u get the email addressess from? Known is handfull, Unknown is worldfull Upvote 0 Downvote
>> all email addresses where do u get the email addressess from? Known is handfull, Unknown is worldfull
Dec 18, 2004 Thread starter #3 peacecodotnet Programmer Joined May 17, 2004 Messages 123 Location US I'll give you an example. Let's say the string was "my email address is kid@rock.com and his email address is you@fool.com." What I want it to do is do something like this: preg_match_all("SOMEPATTERN", $string, $return); and then $return will be some array, that has something like kid@rock.com you@fool.com you see? Peace out, Peace Co. Upvote 0 Downvote
I'll give you an example. Let's say the string was "my email address is kid@rock.com and his email address is you@fool.com." What I want it to do is do something like this: preg_match_all("SOMEPATTERN", $string, $return); and then $return will be some array, that has something like kid@rock.com you@fool.com you see? Peace out, Peace Co.
Dec 18, 2004 #4 ericbrunson Technical User Joined Jan 9, 2004 Messages 2,092 Location US First, read a tutorial on regular expressions. Then try something like: Code: \b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b which, interestingly enough, I found in the first screen of the first hit return by a google search for 'regular expression tutorial' Upvote 0 Downvote
First, read a tutorial on regular expressions. Then try something like: Code: \b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b which, interestingly enough, I found in the first screen of the first hit return by a google search for 'regular expression tutorial'
Dec 21, 2004 #5 vbkris Programmer Joined Jan 20, 2003 Messages 5,994 Location IN try: \b\w+@(\w+\.)+[\w]+\b Known is handfull, Unknown is worldfull Upvote 0 Downvote