replace method

Stream<String> replace(
  1. String regexp,
  2. String replacement,
  3. {bool all = false,
  4. bool caseSensitive = true,
  5. bool unicode = false,
  6. bool dotAll = false}

Replaces matches of regexp with replacement.

By default, only replaces the first match per line. If all is true, replaces all matches in each line instead.

The replacement may contain references to the capture groups in regexp, using a backslash followed by the group number. Backslashes not followed by a number return the character immediately following them.

The caseSensitive, unicode, and dotAll flags are the same as for new RegExp.


Stream<String> replace(String regexp, String replacement,
        {bool all = false,
        bool caseSensitive = true,
        bool unicode = false,
        bool dotAll = false}) =>
    replaceMapped(regexp, (match) => replaceMatch(match, replacement),
        all: all,
        caseSensitive: caseSensitive,
        unicode: unicode,
        dotAll: dotAll);