'引用 microsoft vbscript regular expressions 5.5
'test方法
function btest(byval s as string, byval p as string) as boolean
dim re as regexp
set re = new regexp
re.ignorecase = false
re.pattern = p
btest = re.test(s)
end function
private sub command1_click()
dim p as string
p = "^[^0]\d*$|[1-9]+[.]\d*|[0][.]\d+$"
if not btest(text6, p) then
msgbox "输入不合法"
end if
end sub