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。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 本教程,
:
和 < code>! 是保留字。你尝试过逃离他们吗?According to this tutorial, both
:
and!
are reserved words. Did you try escaping them?.