Regex for email addresses

Example pattern below—edit it or paste your own. All processing runs in your browser. For Python’s re module, switch flavor in the tool.

Flavor

Standard `RegExp` for explanation and preview.

g i m s u y d v (JavaScript)
Contact support@example.com or sales@sub.company.co.uk for details.

Plain-English explanation

Flavor: JavaScript RegExp

Flags: g (find all matches); i (ignore case)

start of string (or line in multiline mode) Then Match one character from: characters from the character "a" to the character "z", characters from the character "A" to the character "Z", characters from the character "0" to the character "9", the character ".", the character "_", the character "%", the character "+", the character "-", repeated one or more times. Then Match the character "@". Then Match one character from: characters from the character "a" to the character "z", characters from the character "A" to the character "Z", characters from the character "0" to the character "9", the character ".", the character "-", repeated one or more times. Then Match the character ".". Then Match one character from: characters from the character "a" to the character "z", characters from the character "A" to the character "Z", repeated between 2 and ∞ times. Then end of string (or line in multiline mode)

More examples

Back to RegExplain