Regular Expression of phone number (mobile phone number, 3-4 area code, 7-8 live video number, 1-4 extension code)
(\ D {11}) | ^ (\ d {7, 8}) | (\ d {
How to convert the format to 3 4 4 when filling in the phone number:A: When filling the mobile phone number, in the KeyUp event to determine the length, when eligible to insert a space after the value$ (' #username '). On (' KeyUp ', function (e) {var val = $ (this). Val ()
/** * User Input phone number, judge whether reasonable or not? Ask, judge the length and judge the input is reasonable * Hide the user phone number in the middle of 4, * ideas: * *. With regular judgment conditions: Length 11-bit judgment there are two methods, regular {11}
the penultimate start position.
length
If this parameter is set and is positive, the string length of the substring being replaced is indicated. If set to negative, it represents the number of characters at the end of the substring to be replaced string . If this parameter is not provided, it defaults to Strlen ( string ) (the length of the string). Of course, if it length is 0, then the function is where it wi
Cell phone number legality judgmentProblem Description: The standard format of mobile phone number of Chinese mainland operators is:Country code + mobile phone number, for example: 8613912345678.Features are as follows: 1, 13 bits
Because the need to maintain privacy for customers, so the mobile phone number can not be fully displayed on the site, but do not have to display, so many sites think of the display but not full display, in the above with an asterisk replacement part of the display, in fact, to do this is very simple, with regular replacement display part of it.
Method 1:
function Hidtel ($
The example of this article for you to share a special character replacement phone number of a part of the method, iOS use-number replacement phone number in the middle four, for your reference, the specific contents are as follows
One, the effect chart
Second, the Code
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.