提取 '@' 之后的子字符串Google Sheets 中用于推文分析的字符
我正在使用以下公式尝试从 B 列中提取子字符串 @sizzlegg 和 @fckoeln_en!,问题是在使用 REGEXTRACT 识别 ' @' 象征。
我需要它直接提取“@”(at/标签符号)之后的任何内容,无论 B 列中值文本的长度或紧随该符号之后的子字符串的长度。
=REGEXEXTRACT(B18,".*@(.*)")
I am using the following formula trying to extract the substring @sizzlegg and @fckoeln_en! from column B, the problem is that I get an error when using REGEXTRACT to identify the '@' symbol.
I need it to extract anything straight after the '@' (at/tag symbol) no matter the length of the value text in column B or the length of the substring immediately after the symbol.
=REGEXEXTRACT(B18,".*@(.*)")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
解释
首先,识别字母数字字符([a-zA-Z0-9_]),后面跟@并在=>周围添加括号;这样我们就会得到一个正则表达式
=REGEXREPLACE(A1,"(@\w+)","($1)")
然后,使用该正则表达式通过
=regexextract(A1,正则表达式)
请注意,
如果 A1 中已有括号
()
,则必须将其删除第一的Try
explantation
first, identifiy alphanumeric characters ([a-zA-Z0-9_]) following with @ and add parentheses around => thus we will get a regular expression
=REGEXREPLACE(A1,"(@\w+)","($1)")
then, use that regular expression to extract these alphanumeric characters with
=regexextract(A1,regular expression)
note
if you have already parentheses
()
in A1, you have to remove them first