G'day bizactuator,
You can capture the two parts with this regex:
/^(.+?)\s+<?(\S+?)>?$/
My test:
$ perl -E 'say join " = ", /^(.+?)\s+<?(\S+?)>?$/ for q{My name <email +@example.com>}, q{My Name email@example.com}' My name = email@example.com My Name = email@example.com
— Ken
In reply to Re: Getting email from fields
by kcott
in thread Getting email from fields
by bizactuator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |