Powered By GitBook
SELECT_BY_REGEX
Find objects from list by a key-regex match

Description

Finds multiple objects from the given list by a key-regex pair.
For example, given Key "name" and Pattern /Agnus/, will return an array containing all objects in the array whose name property contains Agnus, or an empty list if no matching objects were found.

Function signature

1
SELECT_BY_REGEX(array: Array, key: String, pattern: String) => Array
Copied!
Parameter
Description
Array
List to find objects in
Key
Key whose value to match
Pattern
Regex pattern to match

Examples

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