复制代码 代码如下:
<%
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>

关于具体的正则表达式函数
https://www.jb51.net/article/20816.htm

华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com