Skip to content

Instantly share code, notes, and snippets.

View gurleyryan's full-sized avatar
๐Ÿ•ด๏ธ
๐ƒ๐Œฟ๐Œฝ๐Œพ๐Œน๐ƒ

Ryan Gurley gurleyryan

๐Ÿ•ด๏ธ
๐ƒ๐Œฟ๐Œฝ๐Œพ๐Œน๐ƒ
View GitHub Profile
@gurleyryan
gurleyryan / RegexTutorial.md
Last active May 6, 2024 04:12
Module 17: Computer Science for JavaScript Challenge - Regex Tutorial

Regex Tutorial: Matching an Email

A regex - or regular expression - is a sequence of characters that defines a specific search pattern. They can be used to find certain patterns of characters within a string, as well as replace a character or sequence of characters within said string. They are also frequently used to validate input, such as Matching an Email.

Summary

The following Matching an Email regex can be used to verify that a user has input a valid email address:

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