我有一封电子邮件,我需要提取数据。我选择了提取功能,使用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:)
答案 0 :(得分:2)
这个正则表达式应该在第一次&#39; WHEN:&#39;:
之后抓取数据^WHEN:\s(.*?)