Skip to content

Commit

Permalink
Add case insensitive option for regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
SG-Kang authored Dec 19, 2024
1 parent f92e368 commit 8387303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/i18n/phonenumbers/phonenumberutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4759,7 +4759,7 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled =
*/
i18n.phonenumbers.PhoneNumberUtil.matchesEntirely = function(regex, str) {
/** @type {Array.<string>} */
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;
}
Expand Down

0 comments on commit 8387303

Please sign in to comment.