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})$/