Skip to content

Instantly share code, notes, and snippets.

Regular Expression Tutorial Matching an E-mail

A regular expression, regex for short, is a series of characters that are used to identify certain pattern criteria. for the remainder of this tutorial I will be referring to regular expressions simply as regex. Regex are beneficial in coding for their ease of use across multiple programming languages, for tasks such as validations, finding strings, and replacing strings, etc. In this tutorial I will break down how we use regex to match an email.

Summary

this tutorial will focus on the following regex: /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/ This regex can be used to verify an email address. In this tutorial I will breakdowm this regex's indidviual components to give us a better understanding of how regex work and how they can make our lives easier.

Table of Contents

@woodb58
woodb58 / gist_markdown_examples.md
Created June 26, 2022 20:17 — forked from ww9/gist_markdown_examples.md
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these: