transformAll method

String transformAll(
  1. String input
)

Replaces every instance of regex within input with new text as defined by the output template.

Implementation

String transformAll(String input) {
  final matches = regex.allMatches(input);
  var matchOffset = 0;
  for (var match in matches) {
    final output = _output.build(match);
    input = input.replaceRange(
        match.start - matchOffset, match.end - matchOffset, output);
    matchOffset += (match.end - match.start) - output.length;
  }
  return input;
}