Search code examples
.netvb.netregexclientirc

VB.net Regex Get Information


Well I am currently trying to get the word/text in between these 2 things

: and !

I tried this

        Dim nick As String = String.Empty
        Dim p = ":(?<ircnick>.*?)!"
        Dim Matches = Regex.Matches(mail, p, RegexOptions.IgnoreCase Or RegexOptions.Singleline)
        If Matches IsNot Nothing AndAlso Matches.Count > 0 Then
            For Each Match As Match In Matches
                If Match.Groups("info").Success Then
                    nick = (Match.Groups("ircnick").Value)
                End If
            Next
        End If

It doesn't display anything. If you guys can fix this code for me I would be happy :D.


Solution

  • According to this tutorial, both : and ! are reserved words. Did you try escaping them?.