// Checks if a string is a valid americain phone number with regex var phoneFormatterRegex = function (phoneNumber) { return /^d{3}-d{4}$/.test(phoneNumber); }