复制代码 代码如下:
<%
str = request("str")
reg = request("reg")
set regex = new regexp
with regex
.pattern = reg
.ignorecase = false
.global = true
end with
set match = regex.execute(str)
if match.count > 0 then
for each matched in match
response.write "<b><input value=" & matched.value & " ></b> 位置: <b>" & matched.firstindex & "</b> 长
度:"&matched.length&"<br>"
next
else
response.write "<b>" & regex.pattern & "</b> 没有找到匹配"
end if
set regex = nothing
%>
<form method=post>
text:<br>
<textarea cols=50 rows=10 name="str"><%=str%></textarea><br>
regexp:<input name="reg" value="<%=reg%>"><br>
<input type=submit value="regexp">
</form>
关于具体的正则表达式函数
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论