dim myreg as object
set myreg = createobject("vbscript.regexp")
myreg.global=true
myreg.pattern="正则表达式(deerchao.net)"
set mymatches= myreg.execute(查找内容)
for each mymatch in mymatches
' 匹配结果mymatch 下标从 0 开始
’ 括号()只做分组,不做捕获组,(?:)
’ 括号 (?= abc) 环视,位置右边必须有abc字符
mymatch.submatches(0) '第一个捕获组下标从0开始
next mymatch
VBA正则表达式
最新推荐文章于 2024-06-08 13:16:10 发布