![](/img/trans.png)
[英]Regex match a line if a specific string occurs more than once in a line
[英]RegEx to match everything between first occurrence of two words, both of which appear more than once
我收到一封電子郵件,其中需要提取數據。 我正在使用Nintex Workflows RegEx操作,並選擇了提取功能。 我使用在線.NET正則表達式測試器來驗證它是否可以在工作流中正常工作。
我的數據就是這樣。
There is some extra information here that is not needed
WHEN: 12 12:34Z - 12 45:67Z May 16 (I need everything after WHEN:\s until EOL)
WHERE: Around (I do not need this line)
There is some extra information here that is not needed
WHEN: 12 12:34Z - 12 45:67Z May 16 (Duplicate data not needed)
WHERE: Around (I do not need this line)
There is some extra information here that is not needed
我正在使用以下代碼在兩個關鍵字之間進行捕獲。 問題在於它仍然匹配重復數據(?s)(?<=WHEN:\\s).*?(?=WHERE:)
此正則表達式應在第一個“時間:”之后獲取數據:
^WHEN:\s(.*?)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.