coding for 10 digits phone number regular expression code example Example: regex phone number 10 digit ^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$