|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Dim arr, i%, regex
Set regex = CreateObject("vbscript.regexp")
arr = Range("a1:a4")
With regex
.Global = True
' .MultiLine = True
.Pattern = "(?<Year>(19|20)[0-1]\d)[-_/]?(?<month>[0-1]\d)[-_/]?(?<day>[0-3]\d)"
For i = 1 To 4
MsgBox .test(arr(i, 1))
Next
End With
Dim arr, i%, regex
Set regex = CreateObject("vbscript.regexp")
arr = Range("a1:a4")
With regex
.Global = True
.Pattern = "(19|20)\d\d[-_/]?[0-1]\d[-_/]?[0-3]\d"
For i = 1 To 4
MsgBox .test(arr(i, 1))
Next
End With
我想了解一下,既然你下面的这段程序可以达到效果,为什么又要用上面的那个??
对正则不太懂,不好意思 |
|