Skip to content

Instantly share code, notes, and snippets.

@jsegomez
Last active July 30, 2022 03:08
Show Gist options
  • Save jsegomez/9fba43bd8828c35f30dbb3638e868fe4 to your computer and use it in GitHub Desktop.
Save jsegomez/9fba43bd8828c35f30dbb3638e868fe4 to your computer and use it in GitHub Desktop.
Expresión regular para validación de correos electrónicos

Validación de correo electronico

Utilice esta expresión regular para validación de correo electronico en Angular:

<input
    type="email"
    class="form-control"
    name="correo"
    placeholder="Correo"
    required
    #correo="ngModel"
    [ngModel]="usuario.correo"
    pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"
    [ngClass]="{'is-invalid animated shake': correo.invalid && correo.touched}"
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment