Here's a breakthrough in regular expression in parts:
/^ => start of line
\w+ => any word (letters, numbers and underscores) is repeated 1 or more times
([\.-]?\w+)* => a group of [optional period (.) or dash (-), followed by any word repeated one or more times], which may be repeated 0 or more times
@\w+ => an with the character (@) follows any word repeated one or more times
([\.-]?\w+)* => a group of [optional period or dash after any word repeated 1 or more times], which may be repeated 0 or more times
(\.\w{2,3})+ => a group of [period, followed by any word that can be repeated 2-3 times], which can be repeated 1 or more times
$/ => end of line
By the way, here is a really good Introduction to the regular expressions available on Codular .
Steven schobert
source share