Regex for Email Address along with name format [duplicate]

Use backrefs:

/^([\w-.]+) ([\w-.]+) (\1\.\2@([\w-]+.)+[\w-]{2,4})?$/

Leave a Comment