mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'christina23/master'
* christina23/master: Added unit tests for regex fix Improved regex for SMTP parsing
This commit is contained in:
commit
a56fbe408f
5 changed files with 17 additions and 2 deletions
5
CHANGES
5
CHANGES
|
@ -1,3 +1,8 @@
|
||||||
|
3.3.0-dev.551 | 2020-11-17 15:01:04 -0700
|
||||||
|
|
||||||
|
* Added unit tests for regex fix (christina23)
|
||||||
|
|
||||||
|
* Improved regex for SMTP parsing (christina23)
|
||||||
|
|
||||||
3.3.0-dev.548 | 2020-11-17 13:32:57 -0800
|
3.3.0-dev.548 | 2020-11-17 13:32:57 -0800
|
||||||
|
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.3.0-dev.548
|
3.3.0-dev.551
|
||||||
|
|
|
@ -59,7 +59,7 @@ 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)];
|
||||||
|
|
|
@ -19,3 +19,9 @@ three@example.com,
|
||||||
one@example.com,
|
one@example.com,
|
||||||
two@example.com
|
two@example.com
|
||||||
}
|
}
|
||||||
|
john.smith@email.com
|
||||||
|
[john.smith@email.com, jane.doe@email.com]
|
||||||
|
{
|
||||||
|
john.smith@email.com
|
||||||
|
jane.doe@email.com
|
||||||
|
}
|
||||||
|
|
|
@ -15,3 +15,7 @@ s = "ieje one@example.com, eifj two@example.com, asdf three@example.com, one@exa
|
||||||
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);
|
||||||
|
s = "\"Smith, John\" <john.smith@email.com>, \"Doe, Jane\" <jane.doe@email.com>";
|
||||||
|
print extract_first_email_addr(s);
|
||||||
|
print extract_email_addrs_vec(s);
|
||||||
|
print extract_email_addrs_set(s);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue