常用正则集合
Imports System.Text.RegularExpressions Module Module_Regex '判断是否是数字(不带 + - 号) Public Function IsNum(ByVal value As String) As Boolean Return Regex.IsMatch(value, "^\d*[.]?\d*$") End Function '判断是否是数字(带 + - 号) Public Function IsNumeric(ByVal value As String) As Boolean Return Regex.IsMatch(value, "^[+,-]?\d*[.]?\d*$") End Function '判断是否非负整数(不带 + - 号) Public Function IsInt(ByVal value As String) As Boolean Return Regex.IsMatch(value, "^\d*$") End Function End Module