@@ -7,6 +7,7 @@
BR: 'Brazil',
CN: 'China',
CZ: 'Czech Republic',
+ DE: 'Germany',
DK: 'Denmark',
ES: 'Spain',
FR: 'France',
@@ -29,7 +30,7 @@
},
// The supported countries
- COUNTRY_CODES: ['BR', 'CN', 'CZ', 'DK', 'ES', 'FR', 'GB', 'MA', 'PK', 'RO', 'RU', 'SK', 'TH', 'US', 'VE'],
+ COUNTRY_CODES: ['BR', 'CN', 'CZ', 'DE', 'DK', 'ES', 'FR', 'GB', 'MA', 'PK', 'RO', 'RU', 'SK', 'TH', 'US', 'VE'],
/**
* Return true if the input value contains a valid phone number for the country
@@ -85,6 +86,12 @@
isValid = /^(((00)([- ]?)|\+)(420)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(value);
break;
+ case 'DE':
+ // Test: http://regexr.com/39pkg
+ value = $.trim(value);
+ isValid = (/^(((((((00|\+)49[ \-/]?)|0)[1-9][0-9]{1,4})[ \-/]?)|((((00|\+)49\()|\(0)[1-9][0-9]{1,4}\)[ \-/]?))[0-9]{1,7}([ \-/]?[0-9]{1,5})?)$/).test(value);
+ break;
+
case 'DK':
// Mathing DK phone numbers with country code in 1 of 3 formats and an
// 8 digit phone number not starting with a 0 or 1. Can have 1 space
CA: 'Canada',
GB: 'United Kingdom',
country: 'country'
- COUNTRY_CODES: ['BR', 'CA', 'CZ', 'DK', 'FR', 'GB', 'IE', 'IT', 'MA', 'NL', 'RO', 'RU', 'SE', 'SG', 'SK', 'US'],
+ COUNTRY_CODES: ['BR', 'CA', 'CZ', 'DE', 'DK', 'FR', 'GB', 'IE', 'IT', 'MA', 'NL', 'RO', 'RU', 'SE', 'SG', 'SK', 'US'],
* Return true if and only if the input value is a valid country zip code
@@ -86,6 +87,10 @@
isValid = /^(\d{3})([ ]?)(\d{2})$/.test(value);
+ isValid = /^([01245678][0-9]{4})$/.test(value);
isValid = /^(DK(-|\s)?)?\d{4}$/i.test(value);