Merge branch 'set_to_regex-docs' of https://github.com/jlagermann/zeek

- Adjusted the formatting during merge

* 'set_to_regex-docs' of https://github.com/jlagermann/zeek:
  added examples to set_to_regex comments Signed-ff-by: James Lagermann <james.lagermann@corelight.com>
This commit is contained in:
Jon Siwek 2020-05-08 11:47:38 -07:00
commit b5531ecbd3
4 changed files with 18 additions and 3 deletions

View file

@ -4,7 +4,14 @@ module GLOBAL;
## Given a pattern as a string with two tildes (~~) contained in it, it will
## return a pattern with string set's elements OR'd together where the
## double-tilde was given.
## double-tilde was given. Examples:
##
## .. sourcecode:: zeek
##
## global r1 = set_to_regex(set("a", "b", "c"), "~~");
## # r1 = /^?(a|b|c)$?/
## global r2 = set_to_regex(set("a.com", "b.com", "c.com"), "\\.(~~)");
## # r2 = /^?(\.(a\.com|b\.com|c\.com))$?/
##
## ss: a set of strings to OR together.
##