Skip to content

Instantly share code, notes, and snippets.

Avatar

min-k-khant min-hinthar

View GitHub Profile
@min-hinthar
min-hinthar / Regex-Email-Validation-Tutorial.md
Last active Sep 2, 2022
Computer Science for JavaScript: Email Validation Regular Expression Tutorial Gist
View Regex-Email-Validation-Tutorial.md

Computer Science for JavaScript: Email Validation Regular Expression Tutorial

In this tutorial, I will dissect the components that make up a regular expression to validate a user input string for a valid email address. My understanding of what a Regular Expressions is that it is a search pattern expression that can be used to search for or omit objects/characters in any given string.

What Is a Regex? A regex, which is short for regular expression, is a sequence of characters that defines a specific search pattern. When included in code or search algorithms, regular expressions can be used to find certain patterns of characters within a string, or to find and replace a character or sequence of characters within a string. They are also frequently used to validate input.

According to the definition of Regular Expressions on MDN Web Docs: >Regular expressions are patterns used to match character combinations in strings. In JavaScript, regular expressions are also objects. These patterns are used with the exe