您的位置:首页 > 其它

正则表达式的使用

2008-09-21 09:07 78 查看
如判断字符串是否为空

<%

Public Function Validation(Pattern,string1)

Dim RegExp1,Matches

Set RegExp1=New RegExp

RegExp1.Pattern=Pattern

RegExp1.IgnoreCase=True

RegExp1.Global=True

Matches=RegExp1.Test(string1)

Validation=Matches

End Function

Public Function CheckIsEmpty(string1)

CheckIsEmpty=Validation("^$",Trim(string1))

End Function

If CheckIsEmpty("")=True then

Response.Write(" is Empty"

Else

Response.Write(" is not Empty")

End If

%>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: