JS verification learning path: verification of JS phone numbers
Source: Internet
Author: User
Requirements: (1) Telephone Numbers consist of numbers, & quot; (& quot;, & quot;) & quot; and & quot;-& quot; (2) the telephone number is 3 to 8 digits (3). If the telephone number contains a region code, use & quot; (& quot;, & quot;) & quot; or & quot;-& quot; separated from other parts (required: (1) the telephone number is composed of numbers ,"(",") "and"-"constitute (2) the telephone number is 3 to 8 digits (3) if the telephone number contains a district code, the district code is three or four digits (4) the area code is separated by "(", ")" or "-" from other parts. (5) The mobile phone number is 11 or 12 digits. If it is 12 digits, then the first and second digits of the 11-digit mobile phone numbers are "13" (7) the second and third digits of the 12-digit mobile phone numbers are "13". According to these rules, the following regular expressions can be used: (^ [0-9] {3, 4} \-[0-9] {3, 8} $) | (^ [0-9] {3, 8} $) | (^ \ ([0-9] {3, 4} \) [0-9] {3, 8} $) | (^ 0 {0, 1} 13 [0-9] {9} $)
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.