如何将正则表达式应用于 Google 电子表格中的整个列?

How to apply a REGEX to an entire column in Google Spreadsheets?

例如 column C 我有所有包含相同域的电子邮件。此字段由表单填充。

每次在列中插入新记录时,我需要一个函数从字段中删除 @domain.com

伪代码:

=REGEXREPLACE(<this-cell-value>,"@domain.com","")

假设您的数据从第 2 行开始,在 D2 中尝试:

=ArrayFormula(iferror(regexextract(C2:C, "(.+)@")))

这应该从 col C 中提取 @ 之前的所有内容。

看看是否有效?