^ asserts position at start of a line
. matches any character, including unicode (except for line terminators)
(.*) - 1st Capturing Group that matches any zero or more characters other than line terminators, as many times as possible, giving back as needed (greedy)
. matches any character, including unicode (except for line terminators)
$ asserts position at the end of a line
使用
请参阅正则表达式证明。
解释
使用MID
使用 REGEXEXTRACT
使用正则表达式替换
您可以使用该
MID()
函数根据位置和长度提取子字符串。它从位置 2 开始,跳过开头的
*
,并返回LEN-2
字符,因此它不会包含*
结尾的 。此外,使用REGEXMATCH函数断言起始和结束星号字符。
并且,IF函数来分配结果。