这个正则表达式是用.Net正则表达式类编写的。排除子串匹配
所以我有这个字符串:
<div style="text-align:center;font-size: 18px;"><span style="font-size:14px;">11th of April 2015</span> 18:10</div>
我有这样的正则表达式代码:
[0-9]{1,2}(st|nd|rd|th) of \w{3,9} \d{4}<\/span> \d{1,2}:\d{1,2}
此代码返回本场比赛:
11th of April 2015</span> 18:10
是否与正则表达式的可能性排除
(st|nd|rd|th) of
和
</span>
从匹配,使它看起来像这样:
11 April 2015 18:10
我曾尝试与积极的回顾后,但我没有得到它的工作。
使用HTML解析器呢? – hjpotter92
是你正在使用的JavaScript? –
不,我正在使用C#正则表达式 – Encore