Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 1.32 KB

some.markdown

File metadata and controls

54 lines (44 loc) · 1.32 KB
layout title categories published alias tags
default
some
Reference
Functions
some
true
reference-functions-some.html
reference
data functions
functions
some

Prototype: some(regex, list)

Return type: class

Description: Return whether any element of the list matches the regular expression.

Arguments:

  • regex : [Unanchored][unanchored] regular expression to find, in the range .*
  • list : The name of the list variable to check, in the range [a-zA-Z0-9_$(){}\[\].:]+

Example:

    bundle agent test
    {
      classes:
          "some1" expression => some("long string", "test");
          "some2" expression => some("none", "test");

      vars:
          "test" slist => {
                            1,2,3,
                            "one", "two", "three",
                            "long string",
                            "four", "fix", "six",
                            "one", "two", "three",
                          };

      reports:
          "The test list is $(test)";
        some1::
          "some() test 1 passed";
        !some1::
          "some() test 1 failed";
        some2::
          "some() test 2 failed";
        !some2::
          "some() test 2 passed";
    }

See also: [filter()][filter], [every()][every], and [none()][none].