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