ASP implements a function that detects whether a string is a combination of pure letters and numbers _ Application techniques
Source: Internet
Author: User
<%
'******************************
' Function: checkstring (STRNG)
' Parameters: Strng, string to be validated
' Author: Arisisi
' Date: 2007/7/13
' Description: Detects whether a string is a combination of pure letters and numbers
' Example: <%=checkstring (STRNG)%>
'******************************
Function checkstring (STRNG)
Checkstring = True
Dim RegEx, Match
Set regEx = New RegExp
Regex.pattern = "^[a-za-z0-9]+$"
Regex.ignorecase = True
Set Match = Regex.execute (strng)
If Match.count then checkstring= false
End Function
%>
detect for Chinese characters <%
'******************************
' Function: Checkchinese (STRNG)
' Parameters: Strng, to be authenticated characters
' Author: Arisisi
' Date: 2007/7/13
' Description: Detect if Chinese character, return value: true, or false
' Example: <%=checkchinese (STRNG)%>
'******************************
Function Checkchinese (STRNG)
Checkchinese = True
Dim RegEx, Match
Set regEx = New RegExp
Regex.pattern = "\| | \#|\&|\?| \@|\%|\*|\/|\.| \,|\;|\ ' |\:|\-|\_|\+|\^|\ ' "|\=|\<|\>|\"
Regex.ignorecase = True
Set Match = Regex.execute (strng)
If Match.count then checkchinese= false
End Function
%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.