Regular Expressions 101

Community Patterns

Extract all emails from a document.

0

Regular Expression
ECMAScript (JavaScript)

/
(^|\b)([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})
/
gm

Description

The following regex will extract email addresses from a document.

Sample: This is the email: m23oeo_doc@gmail.com and this is john.doe@outlook.com also can use "," master1@yahoo.com, master2@yahoo.es etc. micro.so@aol.com.

Submitted by anonymous - 6 years ago