Optional
disableIf true
, the search will not wrap around to the beginning of the range after reaching
the end. By default, the search will wrap.
Optional
fieldsAn enum of the types of values to search within each field.
Optional
fromThe starting point for the search. If not provided, the search will start
from the top left corner of the range, or from the bottom right if reverse
is true.
Optional
matchIf true
then the text search is case sensitive.
Optional
matchProvides custom logic for matching values during the find operation.
The current cell value being checked against the criteria
.
A default implementation of the find operation's matching logic. You can call this in your custom logic to fall back to the default behavior if needed.
The criteria that the find operation is trying to match. This is typically defined by the user and passed to the find method.
Contextual information about the cell, such as its address or value-related utilities. See ICell.IteratorContext for more details.
A boolean indicating if the value
satisfies the criteria
.
If matchCustom
is provided, this function will override the default matching logic for the find operation.
Use it to implement custom search rules, while the matchDefault
can be used as a fallback for standard criteria.
Example usage:
const options = {
matchCustom: (value, matchDefault, criteria, context) => {
// Custom match logic
if (typeof value === 'string' && value.includes('important')) {
return true;
}
// Fallback to default match
return matchDefault();
}
};
Optional
matchIf true
the text must match the entire cell to be true.
Optional
orientationSpecifies the direction of the search.
Optional
reverseIf true
, the search will proceed in reverse order.
Optional
useDetermines whether the find operation should treat the search text as a regular expression (RegEx).
When true
, the search text will be interpreted as a regular expression (RegEx), allowing for
advanced pattern matching.
If false
, the find operation will not use RegEx but will support three wildcard characters
for flexible searching:
?
(question mark): Matches any single character.*
(asterisk): Matches any number of characters, including zero.~
(tilde followed by ?
, *
, or ~
): Escapes the wildcard characters (?
or *
) to allow
searching for these literal characters in the text.Example usage:
// Search for text matching a RegEx pattern
const Iterator<ICell> results = range.find("\\d+", { useRegex: true}); // Finds numeric values
// Search for text using wildcards
const Iterator<ICell> results = range.find("abc*", { useRegex: false }); // Finds text starting with "abc"
Options for ICellRange.find.