mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Reverts the regex change in dead3226a5
.
The regex change broke some of the external tests. I added some more cases to the regular email btest to hopefully cover all of the cases better.
This commit is contained in:
parent
a56fbe408f
commit
01ec5ebdcd
3 changed files with 14 additions and 4 deletions
|
@ -58,8 +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)];
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
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]
|
||||||
{
|
{
|
||||||
|
@ -22,6 +23,12 @@ two@example.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
|
||||||
|
}
|
||||||
|
john.smith@email.com
|
||||||
|
[john.smith@email.com, jane.doe@email.com]
|
||||||
|
{
|
||||||
|
john.smith@email.com,
|
||||||
jane.doe@email.com
|
jane.doe@email.com
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,3 +19,7 @@ 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);
|
||||||
|
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