服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|JavaScript|易语言|

服务器之家 - 编程语言 - ASP教程 - asp检测是否为中文字符函数

asp检测是否为中文字符函数

2019-09-12 11:13asp主机网 ASP教程

asp检测是否为中文字符函数

  1. <%  
  2. '******************************  
  3. '函数:CheckChinese(strng)  
  4. '参数:strng,待验证字符  
  5. '描述:检测是否为中文字符,返回值:中文为true,否则false  
  6. '示例:<%=CheckChinese(strng)%>  
  7. '******************************  
  8. Function CheckChinese(strng)  
  9. CheckChinese = true  
  10. Dim regEx, Match  
  11. Set regEx = New RegExp  
  12. regEx.Pattern = "\||\#|\&|\?|\@|\%|\*|\/|\.|\,|\;|\'|\:|\-|\_|\+|\^|\""|\=|\<|\>|\ "  
  13. regEx.IgnoreCase = True  
  14. Set Match = regEx.Execute(strng)  
  15. if match.count then CheckChinese= false  
  16. End Function  
  17. %> 

延伸 · 阅读

精彩推荐