【发布时间】:2010-07-26 02:00:05
【问题描述】:
如何将其从 VB.net 转换为 C#。我尝试了在线转换器,但将其放入项目时出现错误。
Dim regexinfo As String = String.Empty
Dim p = "\[news\](?<info>.*?)\[/news\]"
Dim Matches = Regex.Matches(response, 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
regexinfo = (Match.Groups("info").Value)
End If
Next
End If
【问题讨论】:
-
您能更具体地说明您遇到的错误吗?
标签: c# vb.net regex pattern-matching