mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
added examples to set_to_regex comments
Signed-ff-by: James Lagermann <james.lagermann@corelight.com>
This commit is contained in:
parent
695457fe44
commit
2c04a56236
1 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,13 @@ module GLOBAL;
|
|||
## string parsing reducing it to a single backslash upon rendering.
|
||||
##
|
||||
## Returns: the input pattern with "~~" replaced by OR'd elements of input set.
|
||||
##
|
||||
## Examples:
|
||||
## global r1 = set_to_regex(set("a", "b", "c"), "~~");
|
||||
## results: r1 = /^?(a|b|c)$?/
|
||||
##
|
||||
## global r2 = set_to_regex(set("a.com", "b.com", "c.com"), "\\.(~~)");
|
||||
## results: r2 = /^?(\.(a\.com|b\.com|c\.com))$?/
|
||||
function set_to_regex(ss: set[string], pat: string): pattern
|
||||
{
|
||||
local i: count = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue