HBEFindRE returns a position
in the current processed file where sWhat is found. If
a string is not found, function returns 0. The Regular
Expressions can be used with this function. HBEFindRE
fills a value FOUNDLEN with length of
string if string is found.
Arguments:
sWhat - The string to be found in the file.
nFrom - A position in the file where search begins.
The character at nFrom is excluded from the search.
A first character in the file has number 1 and so on. But
if you want search from the first character (begin of the
file) you must set nFrom to 0. This shift make possible using
a value returned from this function as parameter to this function
again. See example. Parameter nFrom is optional. If this argument
is omitted, the function uses 0.
bCase - Determine if searching is case sensitive.
Optional - false is default.
Examples:
' This script counts number of links
' occurrence in the file.
sWhat = "<\\s*A[^>]*?href.*?>.*?</A>"
count = 0
nWhere = HBEFindRE(sWhat,0,False)
While (nWhere > 0)
count = count + 1
nWhere = HBEFindRE(sWhat,nWhere,False)
EndWhile
MsgBox "A file contains " + count + " links."