Regular expression Validation phone format

Source: Internet
Author: User

public class Verifyutils {/** * Verify phone format */public static Boolean Ismobileno (String mobiles) {/* * move: 134, 135, 136, 137, 138, 139 , 150, 151, 157 (TD), 158, 159, 187, 188 * Unicom: 130, 131, 132, 152, 155, 156, 185, 186 Telecom: 133, 153, 180, 189, (1349 Wei Tong) * summed up is the first must be 1, The second digit must be 3 or 5 or 8, the other location can be 0-9 *///string telregex = "[1][3578]\\d{9}";//"[1]" for the 1th digit 1, "[358]" for the second bit can be 3, 5, 8 One, "\\d{9}" Represents a number that can be 0~9, with 9 digits. String Telregex = "\\d{11}";//11-digit if (textutils.isempty (mobiles)) return False;elsereturn mobiles.matches (Telregex);}}

  

Regular expression Validation phone format

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.