Re: Strip emails from a document

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 26, 2013, at 12:20 PM, Daniel Brown <danbrown@xxxxxxx> 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@xxxxxxxxxxxx
http://sperling.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux