|
Posted by Rik on 06/11/06 12:14
Nick Bell wrote:
> The expression:
>
> preg_match_all("/text.*?([A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6})/i",$f,
> $matches);
>
> Returns ONE email address on a line in $f beginning 'text' - how do I
> retrieve ALL the email addresses on a line in $f beginning 'text' in
> php?
>
> Many thanks
Without looking further at e-mail validation, adjust:
"/text.*?([A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6})/i"
to:
"/^text(:?.*?([A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}))*/i"
Note that your regex will think .@..xx a valid email-adress.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|