he same.</p>
<p>The <code>replace</code> function is called with the <a href="dart-core/Match-class.html">Match</a> generated
by the pattern, and its result is used as replacement.</p>
<p>The function defined below converts each word in a string to simplified
'pig latin' using <a href="dart-core/String/replaceAllMapped.html">replaceAllMapped</a>:</p>
<pre class="language-dart"><code>pigLatin(String words) =&gt; words.replaceAllMapped(
    new RegExp(r'\b(\w*?)([aeiou]\w*)', caseSensitive: false),
    (Match