ITeye博客

asp服务端正则表达式验证输入内容格式

fengxu · 2009-01-06 10:54 · ASP · Markdown

函数如下:

Function jugdetel(htmlStr)
if not isnull(htmlStr) then
    Dim regEx
    SET regEx = New Regexp
    regEx.IgnoreCase = True  '设置是否区分字符大小写
    regEx.Global = True  '设置全局可用性
    regEx.Pattern = "<.+?>"   '设置模式
    jugdetel = regEx.Test(htmlStr)  '执行
    SET regEx = Nothing
 end if
End Function

 

返回true或者flase。值需要更换表达式:regEx.Pattern = "<.+?>" 中的<.+?>的就可以

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。