VB.NET REGEX

I must to parse nick name From A webForm.
The Nicname Code is
<a href="member.php?u=95819">!!!SpartakFan!!!</a>

Open in new window

or
<a href="member.php?u=21040">!!DITH!!</a>

Open in new window

I Need TO get Only the value between ">  </a>
If it possible to do with httpwebrequest,please write me the code,if not,write it with using of webbrowser.
Thank YOU.
Replica178Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi Replica178;

This code snippet should do what you need.

' The inoput data / Web Page
Dim input As String = "I Need TO get Only the value between ""> </a>If it possible to do with httpwebrequest,please <a href=""member.php?u=95819"">!!!SpartakFan!!!</a> write me the code,if not,write it with using of webbrowser.Thank YOU. "
' The Regex pattern
Dim pattern As String = "<a href=\x22member.php[^>]+>(?<Nickname>[^<]+)"
' Find all the matches
Dim matches As MatchCollection = Regex.Matches(input, pattern)

' Check to see if any matches were found
If matches.Count > 0 Then
    ' Get the Nickname's
    For Each m As Match in matches
        Console.WriteLine("Nickname = " & m.Groups("Nickname").Value)
    Next
End If

Open in new window


Fernando
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Replica178Author Commented:
ok.Thank you very much
0
Replica178Author Commented:
Thanks
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Fernando SotoRetiredCommented:
Not a problem; glad to help out.  ;=)
0
Replica178Author Commented:
Dim input As String = "I Need TO get Only the value between ""> </a>If it possible to do with httpwebrequest,please <a href=""member.php?u=95819"">!!!SpartakFan!!!</a> write me the code,if not,write it with using of webbrowser.Thank YOU. " 

Open in new window

what i must write here?
0
Fernando SotoRetiredCommented:
Hi Replica178;

That is the string of data that you wish to find the nickname in. In your question you stated this, "I must to parse nick name From A webForm.", I do not know how you are getting the information so I just used a simple string to show how it works. the input variable could be the result of a web request.

Fernando
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.