DekGenius.com
JAVASCRIPT
valid phone number regex with country code
((00)?(+)?d{1,3})[-s]+(d{1,3})[-s]+(d{4,10})
phone number validation regex
// regex to match phone numbers entered with delimiters (spaces, dots, brackets, etc.)
/^+?d{1,4}?[-.s]?(?d{1,3}?)?[-.s]?d{1,4}[-.s]?d{1,4}[-.s]?d{1,9}$/
phone number regex
^(+d{1,2}s)?(?d{3})?[s.-]d{3}[s.-]d{4}$
validate phone number regex
// Commonly used regular expression
// Check 2-9 characters, false if not matched, true if matched
const validateName = (name) => {
const reg = /^[u4e00-u9fa5]{2,9}$/;
return reg.test(name);
};
// Verify phone number
const validatePhoneNum = (mobile) => {
const reg = /^1[3,4,5,6,7,8,9]d{9}$/;
return reg.test(mobile);
};
// Check passwords consisting of 6 to 18 uppercase and lowercase alphanumeric underscores
const validatePassword = (password) => {
const reg = /^[a-zA-Z0-9_]{6,18}$/;
return reg.test(password);
};
phone number validation regex
^(+d{1,2}s)?(?d{3})?[s.-]d{3}[s.-]d{4}$
Matches the following
123-456-7890
(123) 456-7890
123 456 7890
123.456.7890
+91 (123) 456-7890
regex phone number
# Examples of vaild phone numbers it accepts
9054286644
905-428-6644
(905)-428-6644
1-(905)-428-6644
(905)4286644
905 428 6644
12 903 455 6789
# Regex expression
^d{0,3}[- ]?[ ]*[(]?d{3}[)]?[- ]?[ ]*d{3}[- ]?[ ]*d{4}$
phone number regex
^[+0]{0,2}(91)?[0-9]{10}$
regex for valid phone number
^(+d{1,2}s?)?1?-?.?s?(?d{3})?[s.-]?d{3}[s.-]?d{4}$
general phone number regex
^(?:(?:+?1s*(?:[.-]s*)?)?(?:(s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))s*(?:[.-]s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})s*(?:[.-]s*)?([0-9]{4})(?:s*(?:#|x.?|ext.?|extension)s*(d+))?$
phone regex
^s*(?:+?(d{1,3}))?[-. (]*(d{3})[-. )]*(d{3})[-. ]*(d{4})(?: *x(d+))?s*$
regex expression for international phone number
Regex Expression: [0-9]{14}
regex for international phone number
+(9[976]d|8[987530]d|6[987]d|5[90]d|42d|3[875]d|
2[98654321]d|9[8543210]|8[6421]|6[6543210]|5[87654321]|
4[987654310]|3[9643210]|2[70]|7|1)
W*dW*dW*dW*dW*dW*dW*dW*dW*(d{1,2})$
allows for valid international prefixes
© 2022 Copyright:
DekGenius.com