The cell text is not being highlighted when search text is a regular expression

Posted by: krishna.shah on 17 September 2025, 6:12 am EST

  • Posted 17 September 2025, 6:12 am EST

    I am using a regular expression to search for data within a sheet. When my regular expression is

    PosInputRange*VDDMAX
    and the cell text is PosInputRange_AI1_VDDMAX, it matches the cell but does not highlight it.

    I am identifying search blocks and assigning them to the doc.sheet.searchInfo object.
    doc.sheet.searchInfo   = {
        "text": "PosInputRange*VDDMAX",
        "row": 21,
        "col": 0,
        "index": -1
    }

  • Posted 17 September 2025, 6:56 am EST

    Hi,

    As I understand, you are using a regular expression to search for data within a sheet. For example, when your expression is PosInputRange*VDDMAX and the cell text is PosInputRange_AI1_VDDMAX, it successfully matches the cell but does not highlight it. This behavior is expected because SpreadJS does not automatically highlight matched text.

    Since you already have the search result, you can apply styling (e.g., backColor) to highlight the matched cell. Please refer to the attached sample for details:

    https://jscodemine.mescius.io/share/ygKBUMpEsk2ZHFUcvbKyZw/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    Regards,

    Priyam

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels