Skip to content

Commit

Permalink
Merge branch 'master' into extension-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tvislavski authored Dec 23, 2024
2 parents e163288 + 36db917 commit afd29bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions javascript/i18n/phonenumbers/phonenumberutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4759,8 +4759,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled =
*/
i18n.phonenumbers.PhoneNumberUtil.matchesEntirely = function(regex, str) {
/** @type {Array.<string>} */
var matchedGroups = (typeof regex == 'string') ?
str.match('^(?:' + regex + ')$') : str.match(regex);
var matchedGroups = str.match(new RegExp('^(?:' + (typeof regex == 'string' ? regex : regex.source) + ')$', 'i'));
if (matchedGroups && matchedGroups[0].length == str.length) {
return true;
}
Expand Down

0 comments on commit afd29bd

Please sign in to comment.