robbie
04-05-2001, 06:18 AM
Hi there,
I use:
$matches = preg_match_all("<a href="mailto:/(/([[a-z0-9_]|\\-|\\.)+@(([a-z0-9_">a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-">[a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}/">/([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}/</a>",$contents,$result);
to strip all e-mail addresses out of an html file.
It works fine, except for one thing. The output from such a query produces something like the following:
-----
email1@email.com
email2@email.com
h
s
h
co.
-----
Great that it gets the addresses... not so great that it matches those other characters. Anyone have any ideas on how to fix this?
Thanks
Rob
I use:
$matches = preg_match_all("<a href="mailto:/(/([[a-z0-9_]|\\-|\\.)+@(([a-z0-9_">a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-">[a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}/">/([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}/</a>",$contents,$result);
to strip all e-mail addresses out of an html file.
It works fine, except for one thing. The output from such a query produces something like the following:
-----
email1@email.com
email2@email.com
h
s
h
co.
-----
Great that it gets the addresses... not so great that it matches those other characters. Anyone have any ideas on how to fix this?
Thanks
Rob