老师下图重复提取数据如何调整,红色部份代码有问题?
Dim txt As String = e.Form.Controls("TextBox1").value
Dim pattern As String = "招标控制价.*?[0-9 .]*.*?元|投标最高限价.*?[0-9 .]*.*?元|风险控制价.*?[0-9 .]*.*?元|投标最低限价.*?[0-9 .]*.*?元"
Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
For Each match As System.Text.RegularExpressions.Match In rgx.Matches(txt)
msgbox(match.Value )
Dim tb1 As Table = Tables(e.Form.Name & "_Table1")
For Each cr As Row In tb1.Rows
If match.Value.Contains(cr("名称")) AndAlso cr.IsNull("名称") = False Then
Dim str As String = match.Value
Dim s As String = System.Text.RegularExpressions.Regex.Match(str,"[0-9.]+(?=.*?元+)").ToString()
cr("值") = s
End If
Next
Next
此主题相关图片如下:rrrr.png

此主题相关图片如下:eee.png

[此贴子已经被作者于2019/2/26 16:32:39编辑过]