My regex of choice is:
/^[+]?[(]?[0-9]{3}[)]?[-s.]?[0-9]{3}[-s.]?[0-9]{4,6}$/im
Valid formats:
(123) 456-7890
(123)456-7890
123-456-7890
123.456.7890
1234567890
+31636363634
075-63546725
// 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}$/
//To check that the phone number is of 10 digits
let regex=/^[0-9]{10}$/;
let pattern = /^[62|0]+d{10}/gi
let phone = '087887242822'
console.log(pattern.test(phone))
/^d{3}(-|s)d{3}(-|s)d{4}$|^d{10}$|^1sd{3}(-|s)d{3}(-|s)d{4}$|^(1s?)?(d{3})(s|-)?d{3}-d{4}$/