For Each dr As DataRow In DataTables("数据").Select("") Dim mc = System.Text.RegularExpressions.Regex.Matches(dr("案号"), "(?<=.+?)[0-9]+(?=号)") Dim i As Integer = val(mc(0).value) dr("调整后案号") = System.Text.RegularExpressions.Regex.replace(dr("案号"), "(?<=.+?)[0-9]+(?=号)", Format(i, "0000")) Next