/fseek with -r does not look at the file as one long string, it attempts a line by line match, hardly the same as when you would use a regex/regsub on a file read into a binvar.
Please observe the following alias:
alias test {
var %file = FiberOP $+ $ticks
write %file $+(a,$lf,b)
bread %file 0 $file(%file) &bin
echo -a > String: $bvar(&bin,1-) ** Regex: $regex(%file,$bvar(&bin,1-).text,/(a\s+?b)/) ** Regml: $regml(%file,1)
.fopen %file %file
fseek -r %file /(a\s+?b)/
echo -a > Regml: $regml(1)
.fclose %file
.remove %file
}
Or to put it in layman's terms, you can't match patterns that span accross multiple lines with /fseek -r, whereas this is no problem if a $regex/$regsub would exist with binvars.
If $regex/$regsub(ex) would support binvars, that would be bliss. I'd read the html file into a binvar, use a $regsub to remove all newlines, and then I can handle the entire file as one long string without needing to worry about the html being cut to a new line. And actually, it would open up a whole new method of manipulating data in a file...