We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4246175 commit 36db917Copy full SHA for 36db917
javascript/i18n/phonenumbers/phonenumberutil.js
@@ -4759,8 +4759,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled =
4759
*/
4760
i18n.phonenumbers.PhoneNumberUtil.matchesEntirely = function(regex, str) {
4761
/** @type {Array.<string>} */
4762
- var matchedGroups = (typeof regex == 'string') ?
4763
- str.match('^(?:' + regex + ')$') : str.match(regex);
+ var matchedGroups = str.match(new RegExp('^(?:' + (typeof regex == 'string' ? regex : regex.source) + ')$', 'i'));
4764
if (matchedGroups && matchedGroups[0].length == str.length) {
4765
return true;
4766
}
0 commit comments