正则表达式的使用
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
%>
<%
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
%>
相关文章推荐
- 正则表达式的使用和介绍
- VC中使用正则表达式
- 使用正则表达式获取连接字符串某项的值
- java 基础 简单正则表达式使用规则、Math类、Random类、System类、BigInteger类、BigDecimal类、Date类、SimpleDateFormat类、Calendar类
- JAVA - 2、String 类的使用(四)--正则表达式
- 10分钟学习写正则表达式和使用L7防火墙(以封WINBOX为例)
- IOS正则表达式的使用
- Java/Js下使用正则表达式匹配嵌套Html标签
- Linux正则表达式相关知识及命令的使用方法
- 正则表达式使用详解(二)
- JS使用正则表达式验证身份证号码
- .NET正则表达式使用高级技巧之反向引用
- 如何使用JavaScript和正则表达式进行数据验证
- 使用频繁的正则表达式集合
- java中正则表达式的使用
- 使用正则表达式时,容易出错的地方~
- 使用正则表达式替换字符串中的字符
- linux中正则表达式使用
- Shell脚本的编写,sed的使用以及一些正则表达式
- QTP中使用正则表达式