2016-05-17 62 views
0

我有一封郵件需要提取數據。我正在使用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:)

.NET Regex Sample

+0

我不需要捕捉'WHERE:' – JeremyA1

回答

2

匹配此正則表達式應該抓住後,先當「:」:數據

^WHEN:\s(.*?) 
相關問題