Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

countclassesmatching

Suggest changes
Table of contents

Prototype:countclassesmatching(regex, tag1, tag2, ...)

Return type:int

Description: Count the number of defined classes matchingregex.

This function matches classes, using ananchored regularexpression that should match the whole line. The function returns the numberof classes matched.

You can optionally restrict the search by tags, which you can list after the regular expression.

Example:

code
bodycommoncontrol{bundlesequence=>{"example"};}bundleagentexample{vars:# this is anchored, so you need .* to match multiple things"num"int=>countclassesmatching("cfengine");"hardcount"int=>countclassesmatching(".*","hardclass");reports:"Found$(num) classes matching";}

Output:

code
R: Found 1 classes matching

See also:classes defined via augments,classmatch(),classesmatching()

Still need help?

Chat Ask a question on Github Mailing list
Version 
master3.24 (LTS)3.21 (LTS)view all versions

[8]ページ先頭

©2009-2025 Movatter.jp