SheetXL - v0.3.20
    Preparing search index...

    Options for ICellRange.find.

    interface FindOptions {
        disableWrap?: boolean;
        fields?: Content[];
        from?: ICell.Address;
        matchCase?: boolean;
        matchCustom?: (
            value: Scalar,
            matchDefault: () => boolean,
            criteria: FindCriteria,
            context: IteratorContext,
        ) => boolean;
        matchEntireCell?: boolean;
        orientation?: IRange.Orientation;
        reverse?: boolean;
        useRegex?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    disableWrap?: boolean

    If true, the search will not wrap around to the beginning of the range after reaching the end. By default, the search will wrap.

    false
    
    fields?: Content[]

    An enum of the types of values to search within each field.

    [FindField.Formulas]

    from?: ICell.Address

    The 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.

    top left corner or bottom right if reverse
    
    matchCase?: boolean

    If true then the text search is case sensitive.

    false
    
    matchCustom?: (
        value: Scalar,
        matchDefault: () => boolean,
        criteria: FindCriteria,
        context: IteratorContext,
    ) => boolean

    Provides custom logic for matching values during the find operation.

    Type declaration

      • (
            value: Scalar,
            matchDefault: () => boolean,
            criteria: FindCriteria,
            context: IteratorContext,
        ): boolean
      • Parameters

        • value: Scalar

          The current cell value being checked against the criteria.

        • matchDefault: () => boolean

          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.

        • criteria: FindCriteria

          The criteria that the find operation is trying to match. This is typically defined by the user and passed to the find method.

        • context: IteratorContext

          Contextual information about the cell, such as its address or value-related utilities. See ICell.IteratorContext for more details.

        Returns boolean

        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();
    }
    };
    matchEntireCell?: boolean

    If true the text must match the entire cell to be true.

    false
    
    orientation?: IRange.Orientation

    Specifies the direction of the search.

    IRange.Orientation.Row
    
    reverse?: boolean

    If true, the search will proceed in reverse order.

    false
    
    useRegex?: boolean

    Determines whether the find operation should treat the search text as a regular expression (RegEx).

    false
    

    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"