16,552
社区成员
发帖
与我相关
我的任务
分享
--sector: 2, block: 11, key type:A, key count:13
Found valid key:[ffffffffffff]
--sector: 3, block: 15, key type:A, key count:13
--sector:\s*(\d+).*?Found
,取Group(1)
或者
(?<=--sector:\s*)\d+(?=.*?Found)
,取Match.Value Public Function zz(input As String) As String
Dim reg As New Regex("--sector:\s*?(\d+),\s*block:\s*\d+,\s*key\s*type:[A-Z],\s*key\s*count:\s*\d+\s*Found", RegexOptions.Singleline)
Dim m As Match = reg.Match(input)
If m.Success Then
Return m.Groups(1).ToString
Else
Return ""
End If
End Function
Module Module2
Public Function zz(input As String) As String
Dim reg As New Regex("--sector:\s*(\d+).*?Found")
'Dim reg As New Regex("Found valid key:\[ffffffffffff\][\d\D]*?--sector:\s*(\d+)")
Dim m As Match = reg.Match(input)
If m.Success Then
Return m.Groups(1).ToString
Else
Return ""
End If
End Function
End Module
这样取不到啊