# just enough to make thing sanely displayable and pass to git
sub emails {
- ($_[0] =~ /([\w\.\+=\-]+\@[\w\.\-]+)>?\s*(?:\(.*?\))?(?:,\s*|\z)/g)
+ ($_[0] =~ /([\w\.\+=\?"\(\)\-!#\$%&'\*\/\^\`\|\{\}~]+\@[\w\.\-\(\)]+)
+ (?:\s[^>]*)?>?\s*(?:\(.*?\))?(?:,\s*|\z)/gx)
}
sub names {
[PublicInbox::Address::emails('User <e@example.com>, e@example.org')],
'address extraction works as expected');
-is_deeply([PublicInbox::Address::emails('"ex@example.com" <ex@example.com>')],
- [qw(ex@example.com)]);
+is_deeply(['user@example.com'],
+ [PublicInbox::Address::emails('<user@example.com (Comment)>')],
+ 'comment after domain accepted before >');
my @names = PublicInbox::Address::names(
'User <e@e>, e@e, "John A. Doe" <j@d>, <x@x>');