'================================================ ==============
'Function name: getarray
'Usage: extract the link address, separated by $ array $
'Parameter: constr ------ original character of the extracted address
'Parameter: startstr ------ start string
'Parameter: overstr ------ end string
'Parameter: inclul ------ whether startstr is included
'Parameter: inclur ------ whether overstr is included
'================================================ ==============
Function getarray (byval constr, startstr, overstr, inclul, inclur)
On Error resume next
If constr = "$ false $" or constr = "" Or isnull (constr) = true or startstr = "" Or overstr = "" Or isnull (startstr) = true or isnull (overstr) = true then
Getarray = "$ false $"
Exit Function
End if
Dim tempstr, tempstr2, objregexp, matches, match, templisturl
Tempstr = ""
Set objregexp = new Regexp
Objregexp. ignorecase = true
Objregexp. Global = true
Objregexp. pattern = "(" & startstr & "). +? ("& Overstr &")"
Set matches = objregexp. Execute (constr)
For each match in matches
If templisturl = match. value then
Else
Tempstr = tempstr & "$ array $" & Match. Value
Templisturl = match. Value
End if
Next
Set matches = nothing
If tempstr = "" then
Getarray = "$ false $"
Exit Function
End if
Tempstr = right (tempstr, Len (tempstr)-7)
If inclul = false then
Objregexp. pattern = startstr
Tempstr = objregexp. Replace (tempstr ,"")
End if
If inclur = false then
Objregexp. pattern = overstr
Tempstr = objregexp. Replace (tempstr ,"")
End if
Set objregexp = nothing
Set matches = nothing
Tempstr = Replace (tempstr ,"""","")
Tempstr = Replace (tempstr ,"'","")
Tempstr = Replace (tempstr ,"","")
'Tempstr = Replace (tempstr ,"(","")
'Tempstr = Replace (tempstr ,")","")
If tempstr = "" then
Getarray = "$ false $"
Else
Getarray = tempstr
End if
End Function