regExpReplaceAll function

String regExpReplaceAll(
  1. Object? regExp,
  2. String s,
  3. String replace
)

Uses regExp to replace matches at s, substituting with replace.

replace accepts use of $1, $2 or ${1}, ${2} as group place holders.

Implementation

String regExpReplaceAll(Object? regExp, String s, String replace) {
  var theRegExp = parseRegExp(regExp);
  return theRegExp != null ? _RegExpReplacer(replace).replaceAll(regExp, s) : s;
}