From 83873036dac4f470e8a7321aa7536240b1c72725 Mon Sep 17 00:00:00 2001 From: SG-Kang <101150768+SG-Kang@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:42:59 +0900 Subject: [PATCH] Add case insensitive option for regexp --- javascript/i18n/phonenumbers/phonenumberutil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/i18n/phonenumbers/phonenumberutil.js b/javascript/i18n/phonenumbers/phonenumberutil.js index eebc5c4360..c64cd1f922 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil.js +++ b/javascript/i18n/phonenumbers/phonenumberutil.js @@ -4759,7 +4759,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled = */ i18n.phonenumbers.PhoneNumberUtil.matchesEntirely = function(regex, str) { /** @type {Array.} */ - var matchedGroups = str.match('^(?:' + (typeof regex == 'string' ? regex : regex.source) + ')$') + var matchedGroups = str.match(new RegExp('^(?:' + (typeof regex == 'string' ? regex : regex.source) + ')$', 'i')); if (matchedGroups && matchedGroups[0].length == str.length) { return true; }