Hi,
after hours of debugging I am not capable of solving a problem.
I want to parse the HTML of a spanish forum page and get the thread titles.
I tested the regular expression with a third program and seems to be ok, my problem is that the capture group (?<hilo>...) value is updated each 7 loops ( and not each loop like it is supposed to do ) but the value returned by RegExMatch seems to be okay, it changes and is updated at each call.
The code:
Code:
UrlDownloadToFile, http://foros.acb.com/viewforum.php?f=1, fACB
FileRead, html, fACB
res =
pos = 1
Loop
{
sitio := MyRegEx(html,pos)
pos := sitio + 1
if sitio = 0
break
}
MsgBox, Result:%res%
MyRegEx(text,position)
{
local dani, danihilo
cursor:=RegExMatch(text,"<a href=""viewtopic\.php\?t=.+?""\sclass=""topictitle"">(?<hilo>.+?)</a>",dani,position)
res .= "match:" . danihilo . "`n"
return cursor
}
Have you experienced something similar, the captured var value not updating between loops ?
After looking other thread I have declared local the vars for the regex expression groups, but same result.
Thanks for reading