Foxtable(狐表)用户栏目专家坐堂 → 如何提取带单位的数据


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

主题:如何提取带单位的数据

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/11/3 13:40:00 [显示全部帖子]

Dim str As String = "2015年8月收款15万元,支付8000元"
Dim rgx = New System.Text.RegularExpressions.Regex("[0-9.]+[万元|元]+", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
For Each match As System.Text.RegularExpressions.Match In rgx.Matches(str)
    Output.Show(match.Value)
Next
[此贴子已经被作者于2023/11/3 13:45:02编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/11/4 9:01:00 [显示全部帖子]


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/11/4 11:14:00 [显示全部帖子]

学会调试

Select Case e.DataCol.Name
    Case "项目概算"
msgbox(e.oldValue)
msgbox(e.newvalue)
        If e.oldValue > ""
            Dim str As String = e.OldValue
msgbox(str )
            Dim rgx = New System.Text.RegularExpressions.Regex("[0-9.]+[万元|亿元]+", System.Text.RegularExpressions.RegexOptions.IgnoreCase)
            For Each match As System.Text.RegularExpressions.Match In rgx.Matches(str)
msgbox(match.Value)
                e.NewValue = match.Value
            Next
        End If
End Select

 回到顶部