Created
March 3, 2019 16:55
-
-
Save mrnkr/cc9a04815b5b59b7d8f5907206cf1371 to your computer and use it in GitHub Desktop.
Uruguayan phone number validation regex for javascript
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
// accepts cell phone numbers like 091345876 and allows for spacing every three numbers | |
// accepts landline numbers like 26230945 (optional spacing 2 623 09 45) | |
const phone = /^((09[1-9](\s?)([0-9]{3})(\s?)([0-9]{3}))|((2|4)(\s?)([0-9]{3})(\s?)([0-9]{2})(\s?)([0-9]{2})))$/g; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment