تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشكلة في regex
#1
السلام عليكم 
كيف حالكم يا أصدقاء ان شاء الله تكونو ب الف خير
عندي مشكلة في regex

أريد سحب هذه البيانات في ليست فيو
هذه محاولتى اتمنى تصحيح الخطأ لانه لا يجلب كل الاسطر
كود :
           Dim farfour As New ListViewItem

           Dim pageSource = New WebClient().DownloadString("https://www.livesoccertv.com/fr/channels/bein-sports-arabia-1-hd/")
           Dim dat As MatchCollection = Regex.Matches(pageSource, "(?<=df='H:MM'>).+(?=<\/span><span)")
           Dim mtch As MatchCollection = Regex.Matches(pageSource, "(?<=title="").+(?="" id=)")
           Dim liga As MatchCollection = Regex.Matches(pageSource, "(?<="" title="".+>).+(?=<\/a> <\/td>)")


           For i = 0 To dat.Count - 1

               farfour.Text = dat(i).Value
               farfour.SubItems.Add(mtch(i).Value)
               farfour.SubItems.Add(liga(i).Value)
               ListView1.Items.Add(farfour)
           Next
الرد }}}
تم الشكر بواسطة:
#2
تفضل اخي تم التعديل على الكود

كود :
Dim pageSource = New WebClient().DownloadString("https://www.livesoccertv.com/fr/channels/bein-sports-arabia-1-hd/")
       Dim dat As MatchCollection = Regex.Matches(pageSource, "(?<=df='H:MM'>).+(?=<\/span><span)")
       Dim mtch As MatchCollection = Regex.Matches(pageSource, "(?<=title="").+(?="" id=)")
       Dim liga As MatchCollection = Regex.Matches(pageSource, "(?<="" title="".+>).+(?=<\/a> <\/td>)")

       For i = 0 To dat.Count - 1
           Dim farfour As New ListViewItem(dat(i).Value)
           farfour.SubItems.Add(mtch(i).Value)
           farfour.SubItems.Add(liga(i).Value)
           ListView1.Items.Add(farfour)
       Next
الرد }}}
تم الشكر بواسطة: elgokr , حريف برمجة , ابو روضة



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم