手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP正则表达式技巧
ASP正则表达式技巧
摘要:复制代码代码如下:0ThenForEachmatchedinmatchResponse.Write"位置:"&matched.FirstIn...

复制代码 代码如下:

<%

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>

关于具体的正则表达式函数

http://www.jb51.net/article/20816.htm

【ASP正则表达式技巧】相关文章:

ASP如何获取真实IP地址

使用ASP列出NT用户组及用户

ASP调用存储过程的技巧

用ASP+XML打造留言本

15种ASP技巧

ASP实现头像图像随机变换

ASP调用带参数存储过程的几种方式

asp 读取 json 列表解决思路

PJBLOG使用技巧

关于ASP生成伪参数技巧

精品推荐
分类导航