vb.net 正则表达式 取 固定格式的字符:
原始字符串:strsqlTmp=”select * from A_TEST where a_data = '@1@' and b_link = @2@“
其中@包围的是sql文的条件字段,
需要将条件字段取出,单独处理
Dim mc As MatchCollection = Regex.Matches(strsqlTmp,"@([0-9]*?)@")
For i As Integer = 0 To mc.Count - 1
tableHead.Rows.Add(tableHead.NewRow)
tableHead.Rows(tableHead.Rows.Count - 1).Item("I_FIELD_CODE") = mc.Item(i).Value
tableHead.Rows(tableHead.Rows.Count - 1).Item("I_FIELD_NAME") = ""
tableHead.Rows(tableHead.Rows.Count - 1).Item("I_CONTROL_TYPE") = ""
Next