Re: Strip emails from a document

From: Date: Sat, 26 Jan 2013 17:48:43 +0000
Subject: Re: Strip emails from a document
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-320109@lists.php.net to get a copy of this message
What is your input? On Sat, Jan 26, 2013 at 11:29 PM, Tedd Sperling <tedd@sperling.com> wrote: > > On Jan 26, 2013, at 12:20 PM, Daniel Brown <danbrown@php.net> wrote: > > > > It's imperfect, but will work for the majority of emails: > > > > <?php > > function scrape_emails($input) { > > > > preg_match_all("/\b([a-z0-9%\._\+\-]+@[a-z0-9-\.]+\.[a-z]{2,6})\b/Ui",$input,$matches); > > return $matches; > > } > > ?> > > It works imperfectly enough for me. :-) > > Here's the result: > > http://www.webbytedd.com/aa/strip-email/index.php > > Thanks to all. > > Cheers, > > tedd > > PS: Yes, 'extract" is what I meant and more correct than 'strip' as I said. > > _____________________ > tedd@sperling.com > http://sperling.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader

« previous php.general (#320109) next »