2016-11-09 56 views
-1

我嘗試生成一個適當的模式。但我找不到它。正則表達式尋找適當的模式例如

http://www.sporx.com/tvdebugun/ 在這個網站上。我嘗試捕獲 enter image description here

我正在使用c#。 我剛剛創建了這個模式來捕獲每個列表信息。

string pattern [email protected]"<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>" 

謝謝。

+5

有些人總是說:不要用正則表達式解析HTML。 [使用正則表達式來解析HTML:爲什麼不?](http://stackoverflow.com/questions/590747/using-regular-expressions-to-parse-html-why-not)**你可以嘗試像[htmlagilitypack ](http://htmlagilitypack.codeplex.com/)** –

+0

如果有換行符或空格,您是否使用'(。*)'?我認爲'\ s *'會在那裏工作,並且更可靠 –

+0

你對這種情況有什麼不同的方法嗎 –

回答