summaryrefslogtreecommitdiff
path: root/phonenumberutil.cc
diff options
context:
space:
mode:
Diffstat (limited to 'phonenumberutil.cc')
-rw-r--r--phonenumberutil.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/phonenumberutil.cc b/phonenumberutil.cc
index 50d8176..a986009 100644
--- a/phonenumberutil.cc
+++ b/phonenumberutil.cc
@@ -799,8 +799,9 @@ bool PhoneNumberUtil::FormattingRuleHasFirstGroupOnly(
// Note that the pattern explicitly allows for unbalanced parentheses.
const RegExp& first_group_only_prefix_pattern =
reg_exps_->regexp_cache_->GetRegExp("\\(?\\$1\\)?");
- return first_group_only_prefix_pattern.FullMatch(
- national_prefix_formatting_rule);
+ return national_prefix_formatting_rule.empty() ||
+ first_group_only_prefix_pattern.FullMatch(
+ national_prefix_formatting_rule);
}
void PhoneNumberUtil::GetNddPrefixForRegion(const string& region_code,