well perl supports reg expressions i suppose. u'll have to fine out that.
heresz a VB code.
let me explain what it does.
u must have seen google pages? it has all the searched links in green color. i just get the info between the
<font color=#008000> & </font> tags using regExperssion & lo v have the searched links...
try the same in perl using any method. just look inside the font tag.. u'll get what u want. and without the Google API. so u can have unlimited searches!
tell me if u have understood what i am trying to comvey.. i am bad at explaining..
Code:
Dim re As New RegExp
Dim m As Match
sLPattern = "<font color=#008000>"
sRPattern = "</font>"
re.pattern = "(<font color=#008000>([\w\W]*?)(" & sRPattern & ")"
re.IgnoreCase = True
re.Global = True
For Each m In re.Execute(sData)
sLink = LCase(m.value)
sLink = Replace(sLink, sLPattern, "")
Debug.Print sLink
sLink = Replace(sLink, sRPattern, "")
aSplitter = Split(sLink, " - ")
If UBound(aSplitter) > 0 Then
sHTTP = "http://" & aSplitter(LBound(aSplitter))
sHTTP = "<a href ='" & sHTTP & "'>" & sHTTP & "</a>"
End If
If Duplicate Then
SearchString = SearchString & sHTTP & "<br>"
'gCol.Add sHTTP, sHTTP
Else
SearchString = SearchString & sHTTP & "<br>"
'gCol.Add sHTTP
End If
Next
regards
Enter your message below
Sign in or Join us (it's free).