我在这方面苦苦挣扎了一段时间,请您给点提示...
在 Outlook 电子邮件中,我们可以将电子邮件正文中的电子邮件信息转发为:
From: Jackson, Peter
Sent: Tuesday, 26 March 2013 08:25 PM
To: **Match, Me**; GGG
Cc: AAA, BBB; CCC, DDD; EEE, FFF
Subject: FW: Good Morning
或者
From: Jackson, Peter
Sent: Tuesday, 26 March 2013 08:25 PM
To: AAA; GGG
Cc: BBB; **Match, Me**; DDD; EEE, FFF
Subject: FW: Good Morning
现在,如果“收件人”或“抄送”列表中有“匹配,我”,我想在“已发送”中获取日期时间。
我现在拥有的正则表达式是:
(<b>)?Sent:(</b>)?\s(?<MatchDateTime>[A-Z][a-z]{5,8},\s[0-9]{1,2}\s[A-Z][a-z]{2,9}\s[0-9]{4}\s[0-9{1,2}:[0-9][0-9]\s[A-Z]{2})(<br\s?/?>)?(\\r\\n)*?(<b>)?To:(</b>)?\s.[^<]*?(Match, Me).*?(<br\s?/?>)?(\\r\\n)*?(<b>)?Cc:(</b>)?\s.[^<]*?(Match, Me).*?(<br\s?/?>)(\\r\\n)*
这是一些示例文本:
<span lang=\"EN-US\" style=\"font-size:10.0pt;font-family:"Tahoma","sans-serif"\"> BBB, AAA [mailto:AAA.BBB@ccc.com.au]\r\n<br>\r\n<b>Sent:</b> Tuesday, 26 March 2013 5:23 PM<br>\r\n<b>To:</b> **Match, Me**; DDD; EEE<br>\r\n<b>Cc:</b> EEE, ZZZ; GGG, FFF<br>\r\n<b>Subject:</b> RE: Good Morning<o:p></o:p></span>
或者
<span lang=\"EN-US\" style=\"font-size:10.0pt;font-family:"Tahoma","sans-serif"\"> BBB, AAA [mailto:AAA.BBB@ccc.com.au]\r\n<br>\r\n<b>Sent:</b> Tuesday, 26 March 2013 5:23 PM<br>\r\n<b>To:</b> UUU, AAA, DDD; EEE<br>\r\n<b>Cc:</b> Match, Me; ZZZ; GGG, FFF<br>\r\n<b>Subject:</b> RE: Good Morning<o:p></o:p></span>
我的正则表达式只能匹配一个条件(在 To list 或 Cc list 中),但不能同时匹配两者,请您帮忙,谢谢!