Powered By GitBook
EXCLUDE_BY_REGEX
Remove objects from a list by a key-regex match

Description

Removes objects from a list by matching the value of a given key to a regular expression pattern.
Iterates through the list, checking if the value of each object's Key property matches the regex Pattern. Returns a new list which doesn't contain matched objects.
For example, given Key "name" and Value /John/, all objects in the source List whose name property contains the text "John" would be removed from the returned list.

Function signature

1
EXCLUDE_BY_REGEX(list: Array, key: String, pattern: String) => Array
Copied!
Parameter
Description
List
List to exclude objects from
Key
Key whose value to match
Pattern
Regex pattern to match

Examples

1
array = [{"a":2},{"a":"foo bar"},{"a":"foo","b":3}]
2
key = "a"
3
stringPattern = "^foo"
Copied!
Formula
Return value
EXCLUDE_BY_REGEX(array, key, stringPattern)
[{"a":2}]
Last modified 11mo ago
Export as PDF
Copy link