云购推荐,电影下载网页,繁体字转换工具
返回在字符串搜索中找到的匹配的长度。
object.length
object 参数总是一个 match 对象。
下面的代码说明了 length 属性的用法:
function regexptest(patrn, strng) dim regex, match, matches ' 建立变量。 set regex = new regexp ' 建立正则表达式。 regex.pattern = patrn ' 设置模式。 regex.ignorecase = true ' 设置是否区分大小写。 regex.global = true ' 设置全程可用性。 set matches = regex.execute(strng) ' 执行搜索。 for each match in matches ' 遍历 matches 集合。 retstr = retstr & "匹配 " & i & " 位于 " retstr = retstr & match.firstindex & "。匹配的长度为" retstr = retstr & match.length retstr = retstr & "个字符。" & vbcrlf next regexptest = retstrend functionmsgbox(regexptest("is.", "is1 is2 is3 is4"))
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
网友评论