我可以在 Sheets regexmatch() 中使用修饰符吗
Can I use a modifier in Gsheets regexmatch()
我的电子表格中有一个公式:
=sum(filter(gaUsers,regexmatch(gaCategory,"new user funnel"),regexmatch(gaAction,B16)))
单元格 B16 包含字符串 "Create Account"。但在原始数据中,这显示为 "create account"。所以,我想执行 "ignore case" 搜索。类似于:
regexmatch(gaAction,B16)/i // ignore case modifier.
这在 Gsheets 中可行吗?
根据 https://re2.googlecode.com/hg/doc/syntax.html 你可以使用 (?i)
:
像这样的东西应该有用..
regexmatch(gaAction,"(?i)"+B16)
在 GDocs 中,您需要使用 CONCATENATE
函数将子模式附加到另一个模式。仅使用 +
是不行的。
而不只是 B16
,使用
CONCATENATE("(?i)",B16)
整个公式看起来像
=sum(filter(gaUsers,regexmatch(gaCategory,"new user funnel"),regexmatch(gaAction,CONCATENATE("(?i)",B16))))
我的电子表格中有一个公式:
=sum(filter(gaUsers,regexmatch(gaCategory,"new user funnel"),regexmatch(gaAction,B16)))
单元格 B16 包含字符串 "Create Account"。但在原始数据中,这显示为 "create account"。所以,我想执行 "ignore case" 搜索。类似于:
regexmatch(gaAction,B16)/i // ignore case modifier.
这在 Gsheets 中可行吗?
根据 https://re2.googlecode.com/hg/doc/syntax.html 你可以使用 (?i)
:
像这样的东西应该有用..
regexmatch(gaAction,"(?i)"+B16)
在 GDocs 中,您需要使用 CONCATENATE
函数将子模式附加到另一个模式。仅使用 +
是不行的。
而不只是 B16
,使用
CONCATENATE("(?i)",B16)
整个公式看起来像
=sum(filter(gaUsers,regexmatch(gaCategory,"new user funnel"),regexmatch(gaAction,CONCATENATE("(?i)",B16))))