Regex, React, JavaScript, Nodejs, Development.
regular expression checks for a phone number in the format (123) 456–8911 i.e (3 digits)(space)(3 digits)(hyphen)(4 digits) function isValidPhone(phone) { if(/^[\\(]\d{3}[\\)]\s\d{3}-\d{4}$/.test(phone)) { console.log('phone number is valid'); } else { console.log('phone number is invalid') } }