Skip to content

Instantly share code, notes, and snippets.

View JaspreetKhela's full-sized avatar

Jaspreet Khela JaspreetKhela

View GitHub Profile
@JaspreetKhela
JaspreetKhela / githubpages.md
Last active November 8, 2021 02:27
This gist contains the slides from the "How Do I Host My Front-End Website For Free? GitHub Pages Overview" video.
@JaspreetKhela
JaspreetKhela / websitewireframing.md
Last active November 13, 2021 23:06
This gist contains the slides from the "What is Website Wireframing? Website Wireframing Overview" video.
@JaspreetKhela
JaspreetKhela / git.md
Last active October 31, 2021 20:09
This gist contains the slides from the "What is Git? Git Version Control Overview" video.
@JaspreetKhela
JaspreetKhela / html.md
Created October 17, 2021 03:43
This gist contains the slides from the "What is HTML? HTML Boilerplate Code and Tags Overview" video.
@JaspreetKhela
JaspreetKhela / command-line-interface.md
Last active December 20, 2021 22:39
This gist contains the slides from the "What is the Command-Line Interface? Terminal/Git Bash Overview" video.
@JaspreetKhela
JaspreetKhela / introduction-to-web-development.md
Last active December 20, 2021 21:13
This gist contains the slides used in the "So You Want to Become a Web Developer? $$$" video.
@JaspreetKhela
JaspreetKhela / email-regex-tutorial.md
Last active September 17, 2021 21:43
This is a regex tutorial on searching for an email string within a document.

Regular Expression (Regex) Tutorial on Searching for or Validating an Email String

A regular expression (regex) 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.

Summary

In this tutorial, we will analyze the following regular expression to search for email addresses within a document or verify that a user's email address input is a valid email address:

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

Each component of this regex has a unique responsibility to make sure that a user enters an email address that begins with an unspecified number of characters preceding the @ symbol, followed by a domain.