⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subexpressions.vbs

📁 Apress - Managing Enterprise Systems With The Windows Script Host Source Code
💻 VBS
字号:
Dim objRegExp, objMatches, objSubMatches
'Set objRegExp = New RegExp
Set objRegExp = CreateObject("VBScript.RegExp")
' match "digits slash digits slash digits"
objRegExp.Pattern = "(\d+)\/(\d+)\/(\d+)"
Set objMatches = objRegExp.Execute("5/13/2000")
'the first element of the matches collection contains the submatches
Set objSubMatches = objMatches(0).SubMatches
'list the number of sub expression matches and matches
Wscript.Echo "Subexpression count " & objSubMatches.Count
Wscript.Echo "Subexpression 1 " & objSubMatches (0)
Wscript.Echo "Subexpression 2 " & objSubMatches (1)
Wscript.Echo "Subexpression 3 " & objSubMatches (2)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -