Asp Regular Expression checks functions starting with http

Source: Internet
Author: User

'####################################
'Function: ishttp [str]
'Parameter: str, string to be processed
'Author: Mu
'Date: 2007/7/12
'Description: checks 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 email address meets the standard
<%
'******************************
'Function: isemail (strng)
'Parameter: strng, the email address to be verified
'Prepared by: alixixi
'Date: 2007/7/13
'Description: Check whether the email address meets the standard.
'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 China Mobile Phone Numbers '******************************** *************************
'Function: mobilecheck [str]
'Parameter: str, string to be processed
'Author: Mu
'Date: 2007/7/12
Description: Mobile Phone Number detection.
'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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.