Dim str As String = "001 8889 4.045 mm 5920m/s" Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "[0-9.]+(?=.*?mm)") msgbox(mc(mc.count-1).value)
-- 作者:有点甜
-- 发布时间:2019/6/20 21:53:00
--
For Each r As Row In Tables("表A") Dim str As String = r("第一列") Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "[0-9.]+(?=.*?mm)") r("第二列") = mc(mc.count-1).value Next
For Each r As Row In Tables("表A") Dim str As String = r("第一列") Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "[0-9.]+(?=.*?mm)") r("第二列") = mc(mc.count-2).value Next