[英]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.