Skip to content

Instantly share code, notes, and snippets.

@osvik
Created October 26, 2012 19:43
Show Gist options
  • Save osvik/3961003 to your computer and use it in GitHub Desktop.
Save osvik/3961003 to your computer and use it in GitHub Desktop.
Greek phone validation
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