我真的很感谢另一双眼睛告诉我为什么这个捕获组不起作用。
=REGEXREPLACE(A2," ([\w\/ ]+)$", "$1")
我想抓取“-”后的最后一个“单词”(它是一个文件夹路径结构)。 这是我得到的:
Path Final FolderName
Orders - Colonoscopy - Death Certificate
Orders - Colonoscopy -Death Certificate
Orders - Colonoscopy - Death Certificate - Advance Directive
Orders - Colonoscopy - Death Certificate -Advance Directive
Orders - Colonoscopy Orders -Colonoscopy
Patient Records - Radiology Patient Records -Radiology
When I want to be getting:
Death Certificate
Advance Directive
Colonoscopy
Radiology
我知道我之前已经能够在 Google 表格中完成此类操作。
我确实找到了一个适合我的解决方案,但我不明白为什么采用这种方法
RegexReplace() and capturing groups isn't working.
有效的是:
=REGEXEXTRACT(A17,"([^ -][A-Za-z'\/ ]+)$")