Created
October 26, 2012 19:43
-
-
Save osvik/3961003 to your computer and use it in GitHub Desktop.
Greek phone validation
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
var isGreek = { | |
mobile: function(value) { | |
return /^(\+30|0030)?69\d{8}$/.test( value.replace(/[\s\-()\.]/g, "") ); | |
}, | |
landline: function(value) { | |
return /^(\+30|0030)?(210)?\d{7}$/.test( value.replace(/[\s\-()\.]/g, "") ); | |
}, | |
phone: function(value) { | |
return isGreek.mobile(value) || isGreek.landline(value); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment