Dim str As String
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter= "txt文件|*.txt" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
str= FileSys.ReadAllText(dlg.FileName, Encoding.Default)
End If
Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "(?<=<td colspan=""2"">)[0-9]{18}")
Dim md = System.Text.RegularExpressions.Regex.Matches(str, "(?<=<td>)[0-9]{12}")
If mc.count > 0 Then
For i As Integer = 1 To mc.count
Dim dr As DataRow =DataTables("Train_info").find("[Class_ID] = '" & Vars("ClassId")& "' And [ID_CARD] = '" & mc(i-1).value & "' ")
If dr IsNot Nothing Then
dr("examnum") = md(i-1).value
End If
Next
其中带X的身份证都找不出来,正则该怎么修改呢?
[此贴子已经被作者于2016/6/23 13:10:44编辑过]