The following is a regex tutorial on regex validation for an email address for use in JavaScript. We will begin with a sample code of regex for email validation, first by explaining what a regex is and then breaking down the code that each part is used for though this will not be either exhaustive or all inclusive for regex validating an email address. But first, what is a regex?
A regex is short for regular expression (typically shortened to regex or regexp, though it has also been referred to as a rational expression) and is s equence of characters that allows you to create patterns that help match, locate, and manage text and in this case we will show how it is used for matching an email address.