ASP Regular Expressions detect functions _ regular expressions at the beginning of HTTP
Source: Internet
Author: User
'####################################
' Function: Ishttp[str]
' Argument: str, the string to be processed
' Author: wooden Wood
' Date: 2007/7/12
' Description: Detects whether the HTTP connection address or Address bar starts with HTTP
' Example: <%=ishttp (http://www.alixixi.com)%>
'####################################
Function ishttp (str)
Dim regEx
Set regEx = New RegExp
Regex.pattern = "^" (http| HTTP) [a-za-z]{0,1}\:\/\/]
Ishttp = Regex.test (str)
End Function
Verify that the mailing address is compliant
<%
'******************************
' Function: Isemail (STRNG)
' Parameters: strng, email address to be verified
' Author: Arisisi
' Date: 2007/7/13
' Description: Verify that the mailing address is compliant
' Example: <%=isemail (ali@alixixi.com)%>
'******************************
Function Isemail (STRNG)
Isemail = False
Dim RegEx, Match
Set regEx = New RegExp
Regex.pattern = "^\w+ (-\w+) | ( \.\w+)) *\@[a-za-z0-9]+ (\.| -) [a-za-z0-9]+) *\. [a-za-z0-9]+$]
Regex.ignorecase = True
Set Match = Regex.execute (strng)
If Match.count then isemail= true
End Function
%>
Regular expression detection of Chinese mobile phone number ' *********************************************************
' Function: Mobilecheck[str]
' Argument: str, the string to be processed
' Author: wooden Wood
' Date: 2007/7/12
' Description: Detect mobile phone number
' Example: <%=mobilecheck ("13912345678")%>
'*********************************************************
Function MobileCheck (str)
Dim regEx
Set regEx = New RegExp
Regex.pattern = "^ (13[4-9]|15 (8|9)) \d{8}$"
mobilecheck= regex.test (str)
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.