email validation
can somebody please help me to validate the email perfectly step by step
let email = "{last_utterance}"; // replace with the variable that holds the user's input
let emailRegex = /^[^\s@]+@[^\s@]+.[^\s@]+$/;
if (emailRegex.test(email)) {
// The email is valid
} else {
// The email is not valid
} it is always going to valid stage irrespective of adding invalid state
let email = "{last_utterance}"; // replace with the variable that holds the user's input
let emailRegex = /^[^\s@]+@[^\s@]+.[^\s@]+$/;
if (emailRegex.test(email)) {
// The email is valid
} else {
// The email is not valid
} it is always going to valid stage irrespective of adding invalid state



