Regular expressions are a powerful tool in coding that can be used to find patterns in strings of text without needing much more than a single line of code. While the syntax may seem foreign at first, after some practice regular expressions will be an indispensible tool for every coder. In this tutorial I will explain how regular expressions work using a simple example.
For this tutorial we will be using the regular expression below that will match with any valid email address.
/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/