Last active
May 27, 2024 18:01
-
-
Save 2014maximo/019a8e416a05212b1bfb5a03a586dda6 to your computer and use it in GitHub Desktop.
Expresiones regulares para formularios reactivos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VALIDAR CAMPO IP 255.255.255.255 | |
Validators.pattern(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/) | |
//VALIDAD SOLO NÚMEROS | |
Validators.pattern(/^([0-9])*$/),//solo numeros | |
//VALIDAD CAMPO REQUERIDO | |
Validators.required, | |
//VALIDA TELEFONO | |
Validators.minLength(7), | |
Validators.maxLength(10), | |
Validators.pattern(/^([0-9])*$/), | |
//VALIDA CAMPO NOMBRE | |
Validators.minLength(2), | |
Validators.maxLength(30), | |
Validators.pattern(/^[A-Za-z\s\xF1\xD1]+$/)//solo letra | |
//VALIDA CORREO - EMAIL | |
Validators.pattern(/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/),//correo debe tner @ y .com |
Gracias por el Aporte!
Gracias estimado! me fue de mucha utilidad para mi proyecto.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muchas gracias amigo, has salvado una vida