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+))?$
regex expression for international phone number
Regex Expression: [0-9]{14}
© 2022 Copyright:
DekGenius.com