17 y=-------waitproperty("visible",true,10000)
18 on error resume next
on error goto o
19 window("").wintreeview("systreeview32").TYpe micctrldown+"p"+micctrlup
20 定义数组 name=array(1,2,"aa","bb");name(0)=1
21 进行日期YYYY-MM-DD的格式检查:
Function RegExpTest(patrn, strng) Dim regEx, Match, Matches ' Create variable. Set regEx = New RegExp ' Create a regular expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Set case insensitivity. regEx.Global = True ' Set global applicability. Set Matches = regEx.Execute(strng) ' Execute search. For Each Match in Matches ' Iterate Matches collection. RetStr = RetStr & "Match found at position " RetStr = RetStr & Match.FirstIndex & ". Match Value is '" RetStr = RetStr & Match.Value & "'." & vbCRLF Next RegExpTest = RetStr End Function date_pattern="^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((01,3-9])|(1[0-2]))-(29|30)))))$" result_message=RegExpTest(date_pattern, inputbox("请你输入要检查的时间:")) Select case result_message Case "" msgbox("你输入的日期格式与标准不匹配") case else MsgBox(result_message) |
相关阅读: