parsing data with regex and chilkat

Spambox

New member
Joined
Jan 17, 2011
Messages
2
Programming Experience
1-3
My issue:
Regex not inserting text into textbox11 thats being parsed from html.

What I need:
The script logs into the site and parses the text for email addresses. I know its logging in and can see the email addresses because i dumped the data into textbox11. I have no issues getting the HTML to show up but when it comes to parsing the emails it fails. ultimately it will pass the emails into a string and bcc them and that i can do, i just cant get the regex to get the emails.


if anybody could help or point me in the direction i need to go to figure it out thatd be great. I already read the first 2 pages of search on here and havent found anything that helps much. Google has purple links 3 pages deep too :\


My Code:

VB.NET:
Public Sub grabber()
        Dim req As New Chilkat.HttpRequest()
        Dim http As New Chilkat.Http()
        Dim success As Boolean
        success = http.UnlockComponent("Anything for 30-day trial")
        If (success <> True) Then
            MsgBox(http.LastErrorText)
            Exit Sub
        End If
        req.UsePost()
        req.Path = "UNDER NDA"
        req.AddParam("username", "********")
        req.AddParam("domain", "********")
        req.AddParam("password", "LOLPASSWORD")
        req.AddParam("act", "showContacts")

        Dim domain As String
        Dim port As Long
        Dim ssl As Boolean
        domain = "UNDER NDA"
        port = 80
        ssl = False
        Dim resp As Chilkat.HttpResponse
        resp = http.SynchronousRequest(domain, port, ssl, req)
        Dim myMatches As MatchCollection
        Dim myRegex As New Regex("^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")
        Dim t As String = resp.BodyStr
        myMatches = myRegex.Matches(t)
        ' Search for all the words in a string
        Dim successfulMatch As Match
        For Each successfulMatch In myMatches
            Debug.WriteLine(successfulMatch.Value)
            'TextBox11.Text = successfulMatch.Value
        Next


    End Sub



EDIT: not sure if this is in the right subforum or not.
 
Last edited:
not one person knows whats wrong with this? Im really tryin here guys and im stumped. if you want to know what this is for i can tell you i just cant show you the website its parsing from because after all there are two secrets to success.

1. never tell anybody everything you know.
 
Back
Top