Regular Expressions 101

Community Patterns

Check delimited email list validity

1

Regular Expression
ECMAScript (JavaScript)

/
^[,;\s]*(?:([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)(?:\s*[,;]+\s*([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*)*)+[,;\s]*$
/
g

Description

Validates list of email addresses separated by , or ; and possibly spaces. Capture groups will return only the first and last email captured.

Submitted by Kevin Rák - 8 years ago