replace method
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
.
Implementation
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);