Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

`
(?xim)^(?=.*\.[A-Z]+$)(?=([[:alnum:]\.+-]+)@(?1))(?!.*@.*@)(?!.*?@.*\.\d+$)(?!([[:punct:]]))(?!.*\.{2,})(?!.*(?2)@)(?!.*@(?2)).*
`
g

Description

Here is what I came up with for a 'reasonable' e-mail validator.

Explanation @ https://geekalicious.org/d/90-validating-e-mail-addresses-with-regex-pcre

Submitted by 16BitMiker.com - 3 years ago