To understand how Regex works, we will be having a look at this Regex which will match an email: /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/. This Regex may look complicated just by looking at it but we will be breaking down each component of this Regex.