mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'theavgjojo/master'
* theavgjojo/master: UPDATED: improving email address splitting for common comma case
This commit is contained in:
commit
e618be094a
5 changed files with 22 additions and 2 deletions
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
||||||
|
5.1.0-dev.382 | 2022-08-11 10:41:08 -0700
|
||||||
|
|
||||||
|
* UPDATED: improving email address splitting for common comma case (TheAvgJojo)
|
||||||
|
|
||||||
5.1.0-dev.380 | 2022-08-11 10:30:33 -0700
|
5.1.0-dev.380 | 2022-08-11 10:30:33 -0700
|
||||||
|
|
||||||
* Fix a crash related to a broken IPv6 chain (Tim Wojtulewicz)
|
* Fix a crash related to a broken IPv6 chain (Tim Wojtulewicz)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
5.1.0-dev.380
|
5.1.0-dev.382
|
||||||
|
|
|
@ -58,7 +58,7 @@ function extract_first_email_addr(str: string): string
|
||||||
function split_mime_email_addresses(line: string): set[string]
|
function split_mime_email_addresses(line: string): set[string]
|
||||||
{
|
{
|
||||||
local output = string_set();
|
local output = string_set();
|
||||||
local addrs = find_all(line, /(\"[^"]*\")?[^,]+/);
|
local addrs = find_all(line, /(\"[^"]*\")?[^,]+@[^,]+/);
|
||||||
for ( part in addrs )
|
for ( part in addrs )
|
||||||
{
|
{
|
||||||
add output[strip(part)];
|
add output[strip(part)];
|
||||||
|
|
|
@ -13,6 +13,11 @@ three@example.com,
|
||||||
two@example.com,
|
two@example.com,
|
||||||
one@example.com
|
one@example.com
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
three@example.com,
|
||||||
|
two@example.com,
|
||||||
|
one@example.com
|
||||||
|
}
|
||||||
one@example.com
|
one@example.com
|
||||||
[one@example.com, two@example.com, three@example.com, one@example.com]
|
[one@example.com, two@example.com, three@example.com, one@example.com]
|
||||||
{
|
{
|
||||||
|
@ -26,9 +31,17 @@ john.smith@email.com
|
||||||
john.smith@email.com,
|
john.smith@email.com,
|
||||||
jane.doe@email.com
|
jane.doe@email.com
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"Smith, John" <john.smith@email.com>,
|
||||||
|
"Doe, Jane" <jane.doe@email.com>
|
||||||
|
}
|
||||||
john.smith@email.com
|
john.smith@email.com
|
||||||
[john.smith@email.com, jane.doe@email.com]
|
[john.smith@email.com, jane.doe@email.com]
|
||||||
{
|
{
|
||||||
john.smith@email.com,
|
john.smith@email.com,
|
||||||
jane.doe@email.com
|
jane.doe@email.com
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"Smith, John" <john.smith@email.com>,
|
||||||
|
"Doe, Jane" <jane.doe@email.com>
|
||||||
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ s = "one@example.com,two@example.com,three@example.com,one@example.com";
|
||||||
print extract_first_email_addr(s);
|
print extract_first_email_addr(s);
|
||||||
print extract_email_addrs_vec(s);
|
print extract_email_addrs_vec(s);
|
||||||
print extract_email_addrs_set(s);
|
print extract_email_addrs_set(s);
|
||||||
|
print split_mime_email_addresses(s);
|
||||||
s = "ieje one@example.com, eifj two@example.com, asdf three@example.com, one@example.com";
|
s = "ieje one@example.com, eifj two@example.com, asdf three@example.com, one@example.com";
|
||||||
print extract_first_email_addr(s);
|
print extract_first_email_addr(s);
|
||||||
print extract_email_addrs_vec(s);
|
print extract_email_addrs_vec(s);
|
||||||
|
@ -19,7 +20,9 @@ s = "\"Smith, John\" <john.smith@email.com>, \"Doe, Jane\" <jane.doe@email.com>"
|
||||||
print extract_first_email_addr(s);
|
print extract_first_email_addr(s);
|
||||||
print extract_email_addrs_vec(s);
|
print extract_email_addrs_vec(s);
|
||||||
print extract_email_addrs_set(s);
|
print extract_email_addrs_set(s);
|
||||||
|
print split_mime_email_addresses(s);
|
||||||
s = "\"Smith, John\" <john.smith@email.com>,\"Doe, Jane\" <jane.doe@email.com>";
|
s = "\"Smith, John\" <john.smith@email.com>,\"Doe, Jane\" <jane.doe@email.com>";
|
||||||
print extract_first_email_addr(s);
|
print extract_first_email_addr(s);
|
||||||
print extract_email_addrs_vec(s);
|
print extract_email_addrs_vec(s);
|
||||||
print extract_email_addrs_set(s);
|
print extract_email_addrs_set(s);
|
||||||
|
print split_mime_email_addresses(s);
|
Loading…
Add table
Add a link
Reference in a new issue