Skip to main content

ARGREP

Search array values using one or more predicates.
1 min read

Provide at least one predicate and at most 250. Regular expressions are limited to 2048 bytes and do not support backreferences.

Arguments#

keystringrequired#

The array key.

startnumber | stringrequired#

The first index to search. Use "-" for the lowest possible index.

endnumber | stringrequired#

The last index to search. Use "+" for the highest possible index.

optionsObjectrequired#
predicatesArGrepPredicate[]required#

One to 250 predicates. Each is { exact: string }, { match: string }, { glob: string }, or { re: string } for equality, substring, glob, or regular-expression matching.

combine'AND' | 'OR' | 'and' | 'or'#

How to combine predicates. Defaults to OR.

noCaseboolean#

Match case-insensitively. Defaults to false.

withValuesboolean#

Return index-value pairs instead of indexes. Defaults to false.

limitnumber#

Maximum number of matches. If provided, it must be greater than zero.

Response#

string[] | [string, TData][]required

Matching indexes, or index-value pairs when values are requested. TypeScript returns indexes as strings; Python returns integers. No matches returns an empty list.

Values use the SDK's automatic deserialization. Use TData to describe stored JSON values; it defaults to string.

See the server command reference for protocol details.

Was this page helpful?