From 6a07d95f38d722536b41a1c63f3b57057d3d6101 Mon Sep 17 00:00:00 2001 From: Michail Savvakis Date: Fri, 30 Jun 2017 02:35:10 +0300 Subject: [PATCH] Greece and Cyprus alpha and mobile added. --- lib/alpha.js | 4 +++- lib/isMobilePhone.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/alpha.js b/lib/alpha.js index cabc0e831..3438b7f03 100644 --- a/lib/alpha.js +++ b/lib/alpha.js @@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); var alpha = exports.alpha = { 'en-US': /^[A-Z]+$/i, + 'el-GR': /^[Α-Ω]+$/i, 'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i, 'da-DK': /^[A-ZÆØÅ]+$/i, 'de-DE': /^[A-ZÄÖÜß]+$/i, @@ -24,6 +25,7 @@ var alpha = exports.alpha = { var alphanumeric = exports.alphanumeric = { 'en-US': /^[0-9A-Z]+$/i, + 'el-GR': /^[Α-Ω]+$/i, 'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i, 'da-DK': /^[0-9A-ZÆØÅ]$/i, 'de-DE': /^[0-9A-ZÄÖÜß]+$/i, @@ -59,4 +61,4 @@ for (var _locale, _i = 0; _i < arabicLocales.length; _i++) { _locale = 'ar-' + arabicLocales[_i]; alpha[_locale] = alpha.ar; alphanumeric[_locale] = alphanumeric.ar; -} \ No newline at end of file +} diff --git a/lib/isMobilePhone.js b/lib/isMobilePhone.js index c602b2dd7..ca855a1b9 100644 --- a/lib/isMobilePhone.js +++ b/lib/isMobilePhone.js @@ -21,6 +21,7 @@ var phones = { 'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, 'da-DK': /^(\+?45)?(\d{8})$/, 'el-GR': /^(\+?30)?(69\d{8})$/, + 'el-CY': /^(\+?357?)?(9\d{7})$/, 'en-AU': /^(\+?61|0)4\d{8}$/, 'en-GB': /^(\+?44|0)7\d{9}$/, 'en-HK': /^(\+?852\-?)?[569]\d{3}\-?\d{4}$/, @@ -78,4 +79,4 @@ function isMobilePhone(str, locale) { } return false; } -module.exports = exports['default']; \ No newline at end of file +module.exports = exports['default'];