- while ((matcher = PARENTHESIZED.matcher(field)).find()) {
- parenthesized.append(matcher.group(1)).append(" ");
- field = matcher.replaceFirst(" ");
+ if (field.indexOf('(') != -1) {
+ StringBuilder stripped = new StringBuilder(field.length());
+ Matcher matcher = PARENTHESIZED.matcher(field);
+ while (matcher.find()) {
+ parenthesized.append(matcher.group(1)).append(" ");
+ matcher.appendReplacement(stripped, " ");
+ }
+ stripped = matcher.appendTail(stripped);
+ field = stripped.toString();