in reply to Getting email from fields
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting email from fields
by bizactuator (Sexton) on Oct 27, 2017 at 06:22 UTC | |
by hippo (Archbishop) on Oct 27, 2017 at 08:21 UTC | |
by bizactuator (Sexton) on Oct 30, 2017 at 15:24 UTC |