Dim str As String = "福建省泉州市惠安县山霞镇田边村委会159号"
'Dim str As String = "上海市aa区bb街cc路xx号"
Dim ary() As String = {"^", "(省|上海市|北京市|重庆市|天津市|自治区)", "(市|区)", "县", "(镇|街)", "(村)", "$"}
Dim nr = Tables("表a").addnew
For i As Integer = 0 To 5
For j As Integer = i To 0 Step -1
Dim mc = System.Text.RegularExpressions.Regex.Match(str, "(?<=" & ary(j) & ").+" & ary(i+1))
If mc.success Then
msgbox(ary(i+1) & ":" & mc.value.remove(mc.value.length-1))
If i=0 Then
nr("第一列") = mc.value.remove(mc.value.length-1)
End If
If i=1 Then
nr("第二列") = mc.value.remove(mc.value.length-1)
End If
Exit For
End If
Next
Next