I suspect that there are nearly as many solutions to the problem of email address validation as there are projects that require them. I’ve seen a fair amount of them myself over the years, they range from simply checking for the presence of an @
in a string to extremely complex and often flawed sub-routines designed for the task. Get a proper script