Skip to content

Commit

Permalink
Fixes to String.p.replaceAll() doc (mdn#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
Juriy authored Feb 28, 2021
1 parent c737778 commit 6b4ccbe
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ <h3 id="Specifying_a_function_as_a_parameter">Specifying a function as a paramet
used as the replacement string. (<strong>Note:</strong> The above-mentioned special
replacement patterns do <em>not</em> apply in this case.)</p>

<p>Note that the function will be invoked multiple times for each full match to be
replaced if the regular expression in the first parameter is global.</p>
<p>Note that if the first argument of an <code>replaceAll()</code> invocation is a {{jsxref("RegExp")}} object or regular expression literal, the function will be invoked multiple times.</p>

<p>The arguments to the function are as follows:</p>

Expand All @@ -132,7 +131,7 @@ <h3 id="Specifying_a_function_as_a_parameter">Specifying a function as a paramet
<tr>
<td><code>p1, p2, ...</code></td>
<td>The <var>n</var>th string found by a parenthesized capture group, provided the
first argument to <code>replace()</code> was a {{jsxref("RegExp")}} object.
first argument to <code>replaceAll()</code> was a {{jsxref("RegExp")}} object.
(Corresponds to <code>$1</code>, <code>$2</code>, etc. above.) For example,
if <code>/(\a+)(\b+)/</code>, was given, <code>p1</code> is the match for
<code>\a+</code>, and <code>p2</code> for <code>\b+</code>.</td>
Expand Down

0 comments on commit 6b4ccbe

Please sign in to comment.