【发布时间】:2011-10-28 10:07:18
【问题描述】:
我一直在搜索 Stackoverflow,但找不到可以帮助我的确切线程。
我的问题是,我希望能够找到并取出字符串中出现的任何 8 位数字。
Dim SetOfMatches As MatchCollection
Dim MyRegex As New Regex("A^\d{8}$A")
Dim TestString As String = "testing 12345678 testing"
myMatches = myRegex.Matches(TestString)
For each Row as Match in myMatches
console.writeline(row.value)
Next
这不会产生任何命中。但我想找到字符串中间出现的 8 位数字。
我在 RegEx 方面非常基础。
任何帮助都会很棒!
【问题讨论】:
标签: regex vb.net string search digits