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; }