Jump to content
Sign in to follow this  
xorpas

Regex Catch a first Line only

Recommended Posts

hello,

 

I need to extract a group from text But I not fammiliar with regex ,Need some one to help me with Please this is what I got

Untitled.thumb.png.0bf952a43539626c06b84130e67ab6ca.png

 

and this my used pattern

 

<li><strong>([^<]*)</strong></li>.*?</ul>.*?download-pill" href="([^"]*)">([^<]*)</a></p>

text hier

 

 

<hr />
<ul>
<li><strong>خالد المشيقح:</strong></li>
</ul>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/01.mp3">شرح التسهيل 1 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/02.mp3">شرح التسهيل 2 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/03.mp3">شرح التسهيل 3</a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/04.mp3">شرح التسهيل 4</a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/05.mp3">شرح التسهيل 5 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/06.mp3">شرح التسهيل 6</a></p>
<ul>
<li><strong>عبدالسلام الشويعر:</strong></li>
</ul>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/07.mp3">شرح التسهيل 7</a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/08.mp3">شرح التسهيل 8 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/09.mp3">شرح التسهيل 9 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/10.mp3">شرح التسهيل 10</a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/11.mp3">شرح التسهيل 11 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/12.mp3">شرح التسهيل 12 </a></p>
<ul>
<li><strong>سامي الصقير:</strong></li>
</ul>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/13.mp3">شرح التسهيل 13 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/14.mp3">شرح التسهيل 14 </a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/15.mp3">شرح التسهيل 15</a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/16.mp3">شرح التسهيل 16</a></p>
<p><a class="stealth download-pill" href="https://archive.org/download/Kitab_Tasheel_fi_Fiqh/17.mp3">شرح التسهيل 17 </a></p>
<hr />

 

Edited by xorpas

Share this post


Link to post
13 hours ago, Alexander Sviridenkov said:

It is better to use HTML parser for this.

Thank you for replay is this a cross-platform ?

Share this post


Link to post

I resolve it .

 

This is the pattern mybe some one need it

href="([^"]*)">([^"]*)</a></p>|<strong>([^>]*):</str

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×