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

Arguments

str
required
The array key.
int | Literal['-']
required
The first index to search. Use "-" for the lowest possible index.
int | Literal['+']
required
The last index to search. Use "+" for the highest possible index.
The following arguments are keyword-only. Each predicate accepts one pattern or a list of patterns.
str | List[str]
Match the whole value.
str | List[str]
Match a substring.
str | List[str]
Match a glob pattern.
str | List[str]
Match a regular expression.
Literal['AND', 'OR']
How to combine predicates. Defaults to OR.
bool
Match case-insensitively. Defaults to False.
bool
Return index-value tuples instead of indexes. Defaults to False.
int
Maximum number of matches. If provided, it must be greater than zero.

Response

Matching indexes, or index-value pairs when values are requested. TypeScript returns indexes as strings; Python returns integers. No matches returns an empty list.
See the server command reference for protocol details.