result = r.sub(value, replace);
}
props.put(prefix + "replace",
result==null ? nullStr :result);
} else {
int subMatches = Math.min(MAX_MATCHES, r.subspecs());
String[] sub = new String[subMatches];
if (all) { // all matches
Regsub rs = new Regsub(r, value);
StringBuffer counter = new StringBuffer();
while(rs.nextMatch()) {