Skip to content

Instantly share code, notes, and snippets.

View cgsdesign's full-sized avatar

cgsdesign

View GitHub Profile
@cgsdesign
cgsdesign / gist-email-regex.md
Last active January 11, 2021 06:20
REJEX email breakdown

Regex Email Formula Breakdown

Summary

Regex formulas are immensely helpful tool for standardizing a sequence of characters. At their base, they define a search pattern and work across most languages. Ensuring user inputs are provided in the correct format, preventing incorrect data from undermining database integrity, and searching a document are just a few of the valuable uses for regular expression.

/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/

One of the most common and useful regex expressions is the expression above uses to define email address.
Like all regex, this expression can be broken down into parts. This gist will breakdown the code above.