Skip to content

Instantly share code, notes, and snippets.

View BeKind-Rewind's full-sized avatar

Amanda Perry BeKind-Rewind

View GitHub Profile
@BeKind-Rewind
BeKind-Rewind / regex_email_tutorial.md
Last active September 21, 2022 23:35
Matching Email Regex Tutorial

Regex Tutorial for Matching Email

In this tutorial, you will learn about regular expression syntax to extract or match specifically emails out of text data. Regular expressions are a way to describe patterns in a string data.

Summary

The regular expression, or "regex", for matching emails can take on various forms. It includes meta characters which guide the match process. This expression displayed below will cover a vast majority of email scenarios. Regular expressions (regex or regexp) are extremely useful in extracting information from any text by searching for one or more matches of a specific search pattern (i.e. a specific sequence of ASCII or unicode characters). Matching an Email:

`/^([A-Za-z0-9_\.-]+)@([\dA-Za-z\.-]+)\.([A-Za-z\.]{2,6})(\.[A-Za-z]{2,6})?$/`