站内搜索

一个验证用户名是否包含非法字符的函数(VBScript)

Function CheckName(str)
       If str="" Then Exit Function
       Dim re
       Set re=New RegExp
       re.IgnoreCase=true
       re.Global=true
       re.pattern="[~!@#$%^&*()+|<>///? ]"
       CheckName=re.test(str)
       Set re=nothing
End Function

红色的部分就是限定的不能注册的字符,其中符号"/"是标识一个特使字符。比如,//表示/,/(表示(

  • 上一篇:二级域名原理以及程序,申请即可开通
  • 下一篇:一个验证EMAIL是否合法的函数(VBScript)