首页 > 编程 > ASP > 正文

ASP正则表达式技巧

2024-05-04 10:57:13
字体:
来源:转载
供稿:网友

复制代码 代码如下:

<%
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>

关于具体的正则表达式函数
//www.Vevb.com/article/20816.htm

您可能感兴趣的文章:

ASP中过滤UBB和Html标签HTML标签及ASP函数速查表ASP.NET使用正则表达式屏蔽垃圾信息ASP 正则表达式常用的几种方法(execute、test、replace)ASP超级链接和HTML函数正则表达式 修正版asp 使用正则表达式替换word中的标签,转为纯文本asp.net正则表达式删除指定的HTML标签的代码asp正则表达式使用详解asp的RegExp对象正则表达式功能用法[比较全]正则表达式速查表(ASP.NET)asp自动补全html标签自动闭合(正则表达式)ASP正则表达式清除HTML指定标签的方法
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表