local lcAll, lnFound, ln >>* >>create cursor c_urls ( url c(100), thetime t ) >>* >>t = seconds() >>lcAll = filetostr( 'index.dat' ) >>lnFound = occurs( 'http://', lcAll ) >>* >>for ln = 1 to lnFound >> * >> lcURL = substr( lcAll, at( 'http://', lcAll, ln ), 100 ) >> lnNIL = at( chr(0), lcURL ) >> * >> if lnNIL > 0 >> lcURL = left( lcURL, lnNIL - 1 ) >> endif >> * >> insert into c_urls values ( lcURL, datetime() ) >> * >> wait wind str( ln ) nowait >> * >> if inkey() = 113 && character q from quit >> exit >> endif >>next>[snip}
>*--------------------------------------------------------------------------- >function do_it() > > =Peter() > >endfunc >*--------------------------------------------------------------------------- >function Peter() > > local i, RegExp, Match, lcAll > > lcAll= 'http://aa.bb.cc' + chr(0) + 'junk http://xx.bb.cc otherjunk' + chr(0) > > RegExp = CreateObject('VBScript.RegExp') > RegExp.Global = TRUE > RegExp.IgnoreCase = TRUE > RegExp.Pattern = 'http://[^\000 ]+' > > Match = RegExp.Execute(lcAll) > > for i = 0 to Match.Count - 1 > ? Match.Item[i].Value > endfor > >endfunc >*--------------------------------------------------------------------------- >Wow! That was a blazingly fast 5 seconds only, for all 28,000 urls! What I don't fully understand is your note that it's C++. Isn't it VB?