表格查询与新行匹配

Sheets query matches with new line

如何让 sheets 查询匹配包含换行符的单元格?

我尝试了 matches '.*Something.*(?s).*Something.*,但无法正常工作。

我不想更改输入查询的数据。

这是一个示例 sheet:https://docs.google.com/spreadsheets/d/1sYqhuW-5ldfz69LZjSI_L6FwdfGs6pXeMakJKrtMsCw/edit?usp=sharing

你可以做到:

=QUERY(A2:A7, "where lower(A) contains 'pear'")

这是我想出的:

=QUERY(A2:A7, "where lower(A) matches '(.*\n)*.*(pear).*(\n.*)*'")

lower 是完全可选的,我只是用来帮助我进行测试。请记住相应地调整您的 regEx

希望这对你有用,因为我花了很长的时间来做这件事。