Regex para E-mail
-
-
Fala @tales .
Geralmente é utilizada a função 'Validar Texto Utilizando Expressão Regular', onde você passa o texto e a expressão e a função valida.
A função retorna um lógico, se o texto atende a expressão ou não.
-
Achei a resposta:
A melhor Expressão regular(Regex) que encontrei para validar o email é :
/^[\w-.]+@([\w-]+.)+[\w-]{2,4}$/gs
Lembrando que : O retorno desta função é uma lista de listas contendo todas as subsequências encontradas.
Caso você utilize o campo email , basta verirficar se o resultado da função É nula ou vazia, caso verdadeiro, o código regex não validou o email:
That's all folks

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Cadastrar Login