From 7666d15d80d84c43bbec7a2eec64231d798e84a8 Mon Sep 17 00:00:00 2001 From: SG-Kang <101150768+SG-Kang@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:17:21 +0900 Subject: [PATCH] Fix regex logic --- 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 d530dae5e..ba427426a 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil.js +++ b/javascript/i18n/phonenumbers/phonenumberutil.js @@ -4760,7 +4760,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled = i18n.phonenumbers.PhoneNumberUtil.matchesEntirely = function(regex, str) { /** @type {Array.} */ var matchedGroups = (typeof regex == 'string') ? - str.match('^(?:' + regex + ')$') : str.match(regex); + str.match('^(?:' + regex + ')$') : str.match("^(?:" + regex.source + ")$"); if (matchedGroups && matchedGroups[0].length == str.length) { return true; }