dim strok,strno
strok = "12312321$12312312312$12312321$"
strno = "12312321$12312312312$12312321$sdfsd"
function regexptest(patrn, strng)
dim regex, match, matches ' 建立变量。
set regex = new regexp ' 建立规范表达式。
regex.pattern = patrn ' 设置模式。
regex.ignorecase = true ' 设置是否区分字母的大小写。
regex.global = false ' 设置全程性质。
set matches= regex.execute(strng) ' 执行搜索。
for each match in matches ' 重复匹配集合
retstr=retstr &"match found at position "
retstr=retstr&match.firstindex&".match value is '"
retstr=retstr&match.value&"'."&vbcrlf
next
if not isempty(matches) and matches(0).value = strng then
regexptest = true
else
regexptest = false
end if
end function
msgbox(regexptest("[\d+\$]+", strok))
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
-
-
-
-
14 正则表达式
14 正则表达式补:SimpleDateFormat类 SimpleDateDormat主要是用于将日期进行格式...
[阅读全文]
-
-
-
网友评论