2010-05-31 95 views
0

那麼我目前正試圖讓這兩個東西之間的文字/文字VB.net正則表達式獲取信息

:和!

我想這

 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 

它不會顯示任何內容。如果你們可以爲我解決這個問題,我會很高興:D。

+0

仍在尋求幫助。 – xZerox 2010-05-31 23:39:32

回答

0

根據this tutorial:!都是保留字。你試過逃脫它們嗎?

+0

隨着我發佈它給了我這個錯誤 解析「\:\\(??)\!\」 - 對很多)的 – xZerox 2010-05-31 23:18:58

+0

沒關係我想通了!我把2個逃脫不是1:D。 – xZerox 2010-05-31 23:58:13