正则表达式找到适当的模式,例如

时间:2016-11-09 15:24:08

标签: c# html regex

我试着生成一个合适的模式。但我找不到它。

http://www.sporx.com/tvdebugun/ 在这个网站。我试图抓住 enter image description here

我正在使用c#。 我刚刚创建了这个模式来捕获每个列表信息。

string pattern =@"<li class="(odd|even)">(.*)<span class="ch-type">(.*)<\/span>(.*)<span class="ch-time">(.*)<\/span>(.*)<div class="ch-desc">(.*)<span class="ch-name">(.*)<\/span>(.*)<span class="ch-text">(.*)<\/span>(.*)<\/div><\/li>"

感谢。

1 个答案:

答案 0 :(得分:1)

试试这段代码:

(?<=(ch-name">)|(?<=ch-time">)|(?<=ch-type">)|(?<=ch-text">))[\s\S]*?(?=<\/)

演示:https://regex101.com/r/d8PJa9/2