常用正则集合

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
posted @ 2013-01-25 13:47  addressok  阅读(152)  评论(0编辑  收藏  举报