ASP正則表達(dá)式技巧
更新時間:2008年11月10日 00:24:45 作者:
寫了個正則表達(dá)式匹配的東西,用到的也就這幾個函數(shù)了
復(fù)制代碼 代碼如下:
<%
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>
關(guān)于具體的正則表達(dá)式函數(shù)
http://www.dhdzp.com/article/20816.htm
您可能感興趣的文章:
- ASP中過濾UBB和Html標(biāo)簽
- HTML標(biāo)簽及ASP函數(shù)速查表
- ASP.NET使用正則表達(dá)式屏蔽垃圾信息
- ASP 正則表達(dá)式常用的幾種方法(execute、test、replace)
- ASP超級鏈接和HTML函數(shù)正則表達(dá)式 修正版
- asp 使用正則表達(dá)式替換word中的標(biāo)簽,轉(zhuǎn)為純文本
- asp.net正則表達(dá)式刪除指定的HTML標(biāo)簽的代碼
- asp正則表達(dá)式使用詳解
- asp的RegExp對象正則表達(dá)式功能用法[比較全]
- 正則表達(dá)式速查表(ASP.NET)
- asp自動補(bǔ)全html標(biāo)簽自動閉合(正則表達(dá)式)
- ASP正則表達(dá)式清除HTML指定標(biāo)簽的方法

