Foxtable(狐表)用户栏目专家坐堂 → 正则表达式提取问题


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

主题:正则表达式提取问题

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


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

Dim txt As String = "+  1.2990g"
Dim pattern As String = "(?<=\+).*?(?=g)"
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)
    Output.Show(match.Value)
Next

 回到顶部