Skip to content

Commit

Permalink
Tweak to Substitute
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmorley committed Dec 23, 2024
1 parent b2b4009 commit f8c05d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/manual/measures/general-options/substitute.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2>Options</h2>

<p>Each of the <code>"pattern":"replacement"</code> pairs are a separate action, and act on the <em>results</em> of the previous substitute pairs. For example, with <code>"1":"One","10":"Ten"</code>, all occurrences of <em>1</em> are replaced with <em>One</em>, but occurrences of <em>10</em> will not be replaced with <em>Ten</em>, because the first substitution already changed all <em>1</em> characters to <em>One</em>. For the desired behavior, the order can be reversed as <code>"10":"Ten","1":"One"</code>.</p>

<p>Instead of <code>"pattern":"replacement"</code>, single quotes can be used <em>either</em> around the pattern or the replacement. (i.e. <code>'pattern':"replacement"</code> or <code>"pattern":'replacement'</code>, but not <code>'pattern':'replacement'</code>) This can be useful when either the pattern or the replacement contains double quotes. For example, <code>'"':"double quote"</code> replaces all occurrences of <em>"</em> with <em>double quote</em>.</p>
<p>Instead of <code>"pattern":"replacement"</code>, single quotes can be used <em>either</em> around the pattern or the replacement. (i.e. <code>'pattern':"replacement"</code> or <code>"pattern":'replacement'</code>, but not <code>'pattern':'replacement'</code>) This can be useful when either the pattern or the replacement contains double quotes. For example, <code>'"':"double quote"</code> replaces all occurrences of the character <em>"</em> with the string <em>double quote</em>.</p>
</dd>

<dt id="RegExpSubstitute"><code>RegExpSubstitute</code> <small>Default: <code>0</code></small></dt>
Expand Down

0 comments on commit f8c05d6

Please sign in to comment.