Last active
June 21, 2024 02:58
-
-
Save jaimeguaman/5819511 to your computer and use it in GitHub Desktop.
regex validacion celulares chile
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
/^(\+?56)?(\s?)(0?9)(\s?)[98765432]\d{7}$/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Según este post es recomendable usar
\A
y\z
en vez de^
y$.
Incluso RoR genera un ArgumentError al tratar de usar la expresión multi-línea por motivos de seguridad.
Con ese cambio queda así:
/\A(\+?56)?(\s?)(0?9)(\s?)[9876543]\d{7}\z/
De todas formas muchas gracias!! 🚀