MCPcopy Create free account
hub / github.com/google/re2j / replaceAll

Method replaceAll

java/com/google/re2j/RE2.java:395–408  ·  view source on GitHub ↗
(String src, final String repl)

Source from the content-addressed store, hash-verified

393 */
394 // This is visible for testing.
395 String replaceAll(String src, final String repl) {
396 return replaceAllFunc(
397 src,
398 new ReplaceFunc() {
399 @Override
400 public String replace(String orig) {
401 return repl;
402 }
403 },
404 2 * src.length() + 1);
405 // TODO(afrozm): Is the reasoning correct, there can be at the most 2*len +1
406 // replacements. Basically [a-z]*? abc x will be xaxbcx. So should it be
407 // len + 1 or 2*len + 1.
408 }
409
410 /**
411 * Returns a copy of {@code src} in which only the first match for this regexp has been replaced

Callers 3

replaceTestHelperMethod · 0.95
testQuoteMetaMethod · 0.95
testReplaceAllMethod · 0.45

Calls 2

replaceAllFuncMethod · 0.95
lengthMethod · 0.45

Tested by 3

replaceTestHelperMethod · 0.76
testQuoteMetaMethod · 0.76
testReplaceAllMethod · 0.36