Feel free not to use it if you find it too complicated. I went for the
class approach because I wanted to atomise the process and comment it.
The script could easily be converted to a single regex if you prefer.
Though nobody in their right mind would call that regex (or yours,
packed as it is with nested assertions) a simple one.
Dave
On Tue, Dec 15, 2009 at 2:40 PM, Michael Rushton
<
miker...@hotmail.co.uk> wrote:
> Why use a class with lots of functions to do what a simple regex can
> do? Here's what I have, to be used with preg_match(). I'm not sure
> what this regex is lacking (other than checking to see if the domain
> name is real, or if the local-part is in use on that domain name):
>
>
> /^(?!.{255,})(?!.{65,}@)(?:(?:\"[^\"]{1,62}\")|(?:[a-z0-9!#$%&'*+\/=?
> ^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*))@(?:(?:\[(?:(?:25[0-5]|
> 2[0-4][0-9]|[01]?[0-9]{1,2})\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]
> {1,2})\])|(?:(?!.*[^.]{64,})(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.)
> {1,127}(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*))$/i
>
> --
>
> You received this message because you are subscribed to the Google Groups "php-email-address-validation" group.
> To post to this group, send email to
php-email-addr...@googlegroups.com.
> To unsubscribe from this group, send email to
php-email-address-va...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/php-email-address-validation?hl=en.
>
>
>