Google Spreadsheets Regex Case Insensitive (Regexreplace)

前端 未结 4 617
情歌与酒
情歌与酒 2020-12-29 23:41

I\'m trying to create a case insensitive regex query in Google Spreadsheets with the regexreplace function. Is that possible? I\'ve tried the \\i flag and got a #REF error s

4条回答
  •  猫巷女王i
    2020-12-30 00:12

    AFAIK, the only way to enable case-insensitive matching is JavaScript API in google docs.

    Apparently, RE2 syntax does support the inline (?i) case-insensitive modifier:

    =REGEXREPLACE("Test", "(?i)t", "")
    

    An alternative that will work is using a Character class, adding both cases of the letter T..

    =REGEXREPLACE("Test", "[Tt]", "")
    

提交回复
热议问题