Skip to content

Instantly share code, notes, and snippets.

@gitJanaeW
gitJanaeW / regex-gist.md
Created October 16, 2022 22:45
A breakdown of how Regex works

Regex Code Breakdown: Matching an Email

Summary

Regex (short for regular expressions) is a sequence of characters used to check for patterns in a string. This tutorial will explain a sample line of Regex code to breakdown Regex syntax in a practical situation. The sample line or Regex is used to validate an email.

Here is the code regular expression that will be analyzed:

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