Just read the section on binvars, that's all you need to know really.

You'll use $bfind to find the position of a certain string near the part you want to actually retrieve. Then you'll use $bvar(&binvar,%position,N) to retrieve a chunk of this and use regular tools on it like $regex or whatever suits your purpose. After this, you'll increase the position, either by issuing another $bfind for the next occurance of the search string, or by whatever other means.

I've recently made something to parse an insanely long html, here's an example (edited):

Code:
 var %pos = 1, %t
 bread tmp 0 %size &in
 while ($bfind(&in,%pos,id="thread_title_)) {
    %pos = $v1
    %t = $regex(a,$bvar(&in,%pos,930).text,/...../)
    inc %pos $regml(a,5).pos
    %t = $regex(b,$bvar(&in,%pos,930).text,/..../)
    ; do something with $regml(a,N) and $regml(b,N)
  }

What I do here is look for the string ="thread_title_ in the binvar. If it is found, $bfind will return the position. I will use this position together with the $bvar identifier to take a chunk of it by issuing $bvar(&in,%pos,930).text and issue a regex on it to fill some $regmls. I know that a little further are more matches, but of course, they will be outside the 930 char range. So I increment the %pos with the position of the last matched captured expression, and take another chunk.

After that, I know the next match will be very far, so I use $bfind again and set the %pos to that. Then again take a chunk, do regex on it, increase the position, take another chunk, and use $bfind...

How you organise your code will be different for each case, I knew for this html that I would always have matches moderately close together, but groups of matches far from each other in the entire html. I use $bfind to hop in between groups, and once I'm in a group I just take chunks and manually increase the position. It could be different for other html, you may need to use more $bfinds etc. but you should understand the gist of my post.


Gone.