Foxtable(狐表)用户栏目专家坐堂 → 自动填充地址


  共有1922人关注过本帖树形打印复制链接

主题:自动填充地址

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/1 18:07:00 [显示全部帖子]

Dim data As String = "宇,13417XXXX86,广东省汕头市澄海区凤翔街道 南门头XX园94幢302 ,515800"
Dim arr() As String = data.split(",")
msgbox(arr(0))
msgbox(arr(1))
msgbox(arr(3))
Dim str As String = arr(2)
Dim ary() As String = {"^", "(省|市|自治区)", "(市|区)", "县", "(镇|街)", "(村|会)", "$"}
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)
            Exit For
        End If
    Next
Next

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=113910&skin=0

 


 回到顶部