1 # Copyright (C) 2016 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 package PublicInbox::Address;
7 # very loose regexes, here. We don't need RFC-compliance,
8 # just enough to make thing sanely displayable and pass to git
10 sub emails { ($_[0] =~ /([^<\s]+\@[^>\s]+)/g) }
15 $name =~ s/\s*\S+\@\S+\s*\z//;
16 if ($name !~ /\S/ || $name =~ /[<>]/) { # git does not like [<>]
17 ($name) = emails($val);
20 $name =~ tr/\r\n\t/ /;