[英]Regex: Get string between first occurrence of string A and first occurrence of string B starting from the end of string A
使用正则表达式从字符串 A 的末尾开始获取字符串 A 的第一次出现和字符串 B 的第一次出现之间的字符串。
源字符串
'apple is maybe green apple is big and dog is green maybe pineapple is cat maybe is'
这应该满足您的要求:
用它构建一个函数来返回字符串:
这行得通吗?
(?<=maybes*).+?(?=s*is)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.