Regex 删除文本并仅显示部分答案
我试图运行一个索引匹配,返回一些文本,但我不想要全文,只想要集合中变化的部分。例如,单元格A1将包含Regex 删除文本并仅显示部分答案,regex,google-sheets,google-sheets-formula,array-formulas,Regex,Google Sheets,Google Sheets Formula,Array Formulas,我试图运行一个索引匹配,返回一些文本,但我不想要全文,只想要集合中变化的部分。例如,单元格A1将包含 [I want to better understand what you did during this visit] During this visit, did the you... (select appropriate answer) [Receive a tour] A2 你会如何提取它,只是说 A1 A2 Receive a tour Meet w
[I want to better understand what you did during this visit] During this visit, did the you... (select appropriate answer) [Receive a tour]
A2
你会如何提取它,只是说
A1 A2
Receive a tour Meet with the manager
文本可能变化很大,有时会有第二组方括号,有时不会。但谷歌表单数据中的一个一致性是,最后一对方括号是包含不同答案的部分。我只想得到这篇文章
…最后一对方括号是包含不同答案的部分。我只想得到这段文字
试试这个:
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(A1:A, "([^\[]*)\]$")))
或者更直截了当地说:
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(A1:A, "\s\[(.*)\]$")))
=ARRAYFORMULA(IFERROR(REGEXEXTRACT(A1:A, "\s\[(.*)\]$")))