Table of Contents

Match

15 December 2023

  • C12 - added the regular expression option.

unknown C10 - initial

match (Sifts)
TypeCorrade progressive sift
Siftmatch
Parametersa string representing a regular expression
DescriptionThe match sift will match the whole returned list against a provided regular expression.
Last ChangesNone

The match sift will match the whole returned list against a provided regular expression.

Arguments

Name Type Description Example
pattern a string a regular expression Item Cost ([0-9]+)
options a CSV of strings regular expression engine options IgnoreCase,Compiled

The full list of regular expression options that can be passed is documented on the Microsoft website.

Example

The following sift when added to a command will skip the first element and then return all subsequent subgroups matching the expression Item Cost ([0-9]+):

    "sift", wasListToCSV([
        "skip", 1,
        "match", wasURLEscape(
            wasKeyValueEncode(
                [
                    "pattern", "Item Cost ([0-9]+)",
                    "options", wasListToCSV([ "IgnoreCase", "Compiled" ])
                ]
            )
    ]),

Effect on Returned Data

Given the input

data=1,Item Cost 100,2,Item Cost 500,3,Item Cost 10,4,Item Cost 15

the expected output is:

data=100,500,10,15

Notes