zeek/testing/btest/bifs/find_all_ordered.zeek
Jon Siwek a852ab4c39 Add find_all_ordered() BIF
Operates similar to find_all(), except returns a vector instead of
set to allow preservation of order/duplicates.
2020-08-11 11:26:21 -07:00

19 lines
458 B
Text

# @TEST-EXEC: zeek -b %INPUT >out
# @TEST-EXEC: btest-diff out
event zeek_init()
{
local v = vector("this is a test",
"one two three four one two three four",
"this is a test test test",
"1 2 3 4",
"a b",
"foo",
"1bar2foo3",
""
);
local pat = /[a-z]+/;
for ( i in v )
print find_all_ordered(v[i], pat);
}