Example of mobile phone number and email address verification in js

Source: Internet
Author: User
Tags php regular expression

Summary of the methods for verifying mobile phone numbers and email addresses using javascript. Although there are many such examples on the Internet, it is always the best to write the code by yourself. The following two examples are prepared by yourself, share with you.

// Function is_mobile (value) {var pattern =/^ 1 [358] [0123456789] \ d {8 }$/; if (! Pattern. test (value) {return false;} return true ;}
// Verify email correctness using javascript function is_email (value) {var pattern =/^ \ w + (-\ w +) | (\. \ w +) * \ @ [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $/; if (! Pattern. test (value) {return false;} return true ;}
Articles you may be interested in
  • Js verification mobile phone number function (from Ding ding map)
  • Use JavaScript to verify the regular expression of the mobile phone number
  • Javascript, php Regular Expression verification for mixed numbers and letters (6-15 digits)
  • Php uses the filter function to verify the mailbox, url, and IP address
  • Php mobile phone number Retrieval
  • Common Javascript Verification Code collections such as js verification URLs
  • Examples of using Google map for javascript development roadmap
  • How to verify the validity of date and time using javascript

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.