Ozan Ertürk Ozan Ertürk - 24 days ago 7
C# Question

Regex finding proper pattern for example

I am try to generate a proper pattern. But I couldn't find it.

http://www.sporx.com/tvdebugun/
in this site. i try to capture
enter image description here

I am using c#.
I just created this pattern to capture each lists information's.

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>"


thanks.

Answer

Try this code:

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

Demo: https://regex101.com/r/d8PJa9/2

Comments