nationalPrefixFormattingRule =
FG_PATTERN.matcher(nationalPrefixFormattingRule).replaceFirst("\\$1");
numFormatCopy.setNationalPrefixFormattingRule(nationalPrefixFormattingRule);
} else {
// We don't want to have a rule for how to format the national prefix if there isn't one.
numFormatCopy.clearNationalPrefixFormattingRule();
}
userDefinedFormatsCopy.add(numFormatCopy);
} else {
// Otherwise, we just add the original rule to the modified list of formats.
userDefinedFormatsCopy.add(numFormat);