I am pretty much new with regular expression. I am developing a project in PHP and i need to validate email address. After searching in this site and google i found the fol
Email validation regex (domain with sub domains)
^((([a-z0-9]+[\-]{0,1})+[a-z0-9]+?\.)+[a-z0-9][a-z0-9|\-]+[a-z0-9])@([a-z0-9]+[\-|\.]{0,1}[a-z0-9]+)+(.[a-z0-9]{2,})+$
Sample tests https://regex101.com/r/w5VBdf/20
Domain with sub domains
^([a-z0-9]+[\.|\-]{0,1}[a-z0-9](.[a-z0-9]{2,})+)$
https://regex101.com/r/4Un8Tz/2
Email username
^([a-z0-9]+[\.|\-]{0,1}[a-z0-9]{1,})+@$
https://regex101.com/r/4Un8Tz/6