Validates whether a given string is an email using a regular expression.
13 weeks ago
function isValidEmail(email: string): boolean { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailRegex.test(email); }