Skip to content

Instantly share code, notes, and snippets.

View brianbixby's full-sized avatar
🤓
Always Building & Learning

Brian Bixby brianbixby

🤓
Always Building & Learning
View GitHub Profile

Regular Expression Tutorial: Validating an Email Address

Validating user inputs and matching search strings has become increasingly important in today's digital age. One of the most valuable and indecipherable (at least at first) tools for this are Regular expressions, or RegEx for short. Regular expressions are a series of characters that defines a search pattern in a body of text. In this tutorial we will thoroughly decipher the following regular expression which we will call "Matching an Email":

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

Summary