Count

C10 - initial

count (Sifts)
TypeCorrade progressive sift
Siftcount
Parametersa string representing a regular expression (regex)
DescriptionThe count sift will count the number of items in a list that match a supplied regular expression.
Last ChangesNone

The count sift will count the number of items in a list that match a supplied regular expression.

Arguments

Position Type Description Example
0 regex string A regular expression to match each individual element of the list against. [0-9]

The regular expression dialect used by Corrade is the .NET regex dialect.

Example

The following sift when added to a command will skip the first 2 items and then count the number of elements of the list that match the regular expression /[0-9]+?/:

    "sift", wasListToCSV([
        "skip", 2,
        "count", "[0-9]"
    ]),

Effect on Returned Data

Given the input

data=a,1,c,2,e,3,h,4,h,5,j,7

the expected output is:

data=5

secondlife/scripted_agents/corrade/api/sifts/count.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.