Two Regexp in a loop ASP

Function VeriBul(BaslangicDegeri,BitisDegeri)

  Set RegEx = New RegExp
  RegEx.IgnoreCase = True
  RegEx.Global = True
  RegEx.Pattern = "(" & BaslangicDegeri & ")(.+?)(" & BitisDegeri & ")"
  Set Sonuc = RegEx.Execute(Mid(strRetval,29600,254000))

  For Each i in Sonuc
 VeriBul =  VeriBul & tr2(i.SubMatches(1))

    Set RegEx2 = New RegExp
    RegEx2.IgnoreCase = True
    RegEx2.Global = True
    RegEx2.Pattern = "(<hemenalfiyat>)(.+?)(</hemenalfiyat>)"
    Set Sonucx = RegEx2.Execute(Mid(strRetval,33000,2000))

     For Each y in Sonucx
     VeriBul2 =  VeriBul2 & tr2(y.SubMatches(1))
     Next

     When it works then appering error

  Next

======================================================

For Each i in Sonuc
  i.SubMatches(1)

For Each y in Sonucx
  y.SubMatches(1)

  Next
  Next

How I can print this except Submatches code? because I have two regexp code (so Im used as Regex2) like that and I can't use to Submatches again.

Thanks,

Answers


Difficult to fix this without the rest of your code (tr2) and your input and desired output but i gues your code should be something like this

Function VeriBul(BaslangicDegeri,BitisDegeri)

  Set RegEx = New RegExp
  RegEx.IgnoreCase = True
  RegEx.Global = True
  RegEx.Pattern = "(" & BaslangicDegeri & ")(.+?)(" & BitisDegeri & ")"

  Set RegEx2 = New RegExp
  RegEx2.IgnoreCase = True
  RegEx2.Global = True
  RegEx2.Pattern = "(<hemenalfiyat>)(.+?)(</hemenalfiyat>)"

  Set Sonuc = RegEx.Execute(Mid(strRetval,29600,254000))
  Set Sonucx = RegEx2.Execute(Mid(strRetval,33000,2000))

  For Each i in Sonuc
    VeriBul =  VeriBul & tr2(i.SubMatches(1))
  Next
  For Each y in Sonucx
   VeriBul =  VeriBul & tr2(y.SubMatches(1))
  Next

Next

Need Your Help

php exec doesn't work for ping on server

php arrays server exec ping

I'm trying to ping an IP with exec function to know if IP gets pinged or not, it works totally fine on localhost and returns the output array, but when I run it on the server it returns an empty ou...

Fake infinite scroll (jQuery)

javascript jquery

i have a &lt;table&gt; with many rows (about 10.000) but i just want to display the first 20 rows when i visit the page and when i scroll to the bottom of the table i want to display the next 20 re...