Skip to main content

RemoveMatches

This Script is part of the Filters And Transformers Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.10.0 and later.

Removes items from the given list of values if they match any of the patterns in the provided filters. If the match_exact argument is 'yes', direct string compare is used, otherwise the comparison is done using regex.

Example:#


value (Get):#
[
"https://domain1.com/some/url",
"http://another.url.com",
"domain2.com/faq",
"domain3.com/login",
"sub.domain3.com/login"
]
filters:#
^*.\.domain1.com/.*\n
^*.\.domain2.com/.*\n
^sub.domain3.com/.*
Result:#
[
"http://another.url.com",
"domain3.com/login"
]

Script Data#


NameDescription
Script Typepython3
Tagstransformer, entirelist, general
Cortex XSOAR Version6.10.0

Inputs#


Argument NameDescription
valueThe value on which the transformer is applied.
ignore_caseWhether to ignore the case of the item for which you are searching. Default is "Yes".
match_exactWhether to match the exact item in the list, or look for any string that contains it. Default is "No".
delimiterA string used to delimit fields. For example, a new line "\n" should match the list separator configuration.
filtersA list of patterns to remove from the value. This can be a single string or a list of patterns, separated by the pattern defined in the delimiter argument. Unless match_exact is yes, regex pattern is supported.

Outputs#


There are no outputs for this script.