A dollar sign can be ordinary text in one field and an instruction in another. In a regular-expression search, $ marks a boundary. In replacement text, combinations such as $1 can refer to captured text. Choosing the correct mode prevents a small symbol edit from producing an unexpected result.
The Find and Replace Text tool handles plain-text replacement and regex replacement differently. Start with the mode that fits the edit, then check a short sample before copying the output.
Replace dollar symbols as plain text
The first two fictional price labels below already refer to US dollars. The goal is to show their currency code; the euro label should remain unchanged.
Notebook: $12.00
Pen: $2.50
Euro label: €3.00
- Paste the sample into Your text.
- Enter
$in Find. - In Replace with, enter
USDfollowed by one ordinary space. - Leave Use regular expression and Whole word only off. Turn Match case and Replace all on.
- Select Replace.
Expect two replacements and:
Notebook: USD 12.00
Pen: USD 2.50
Euro label: €3.00
The digits and euro label stay unchanged. This is a label-formatting operation; it does not convert currencies or establish what a dollar sign meant in an unknown source.
Escape the symbol when regex mode is necessary
With regex mode on, searching for a bare $ does not search for the printed character. It asserts the end of the input without consuming a character, as documented in the MDN input-boundary reference. The current tool rejects that pattern because it can match an empty string.
To repeat the price-label edit in regex mode, enter \$ in Find, with one backslash, no surrounding slashes and no flags. Keep the other settings and replacement unchanged. Expect the same two replacements. MDN lists this syntax in its character-escape reference. For this simple symbol edit, plain-text mode avoids the extra syntax.
Keep literal dollar tokens in the replacement
The replacement field needs a separate decision. With regex mode off, the tool inserts its contents literally. For example, searching for COST in Shown token: COST and replacing it with $& produces Shown token: $&.
With regex mode on, the tool expands certain dollar tokens. For the same input, set Find to (COST), leaving whole-word mode off and the other controls on. Each row below is a separate run:
| Replace with | Text inserted for COST |
|---|---|
$& |
COST, the complete match |
$1 |
COST, the first captured group |
$$ |
A single $ |
$$1 |
The literal text $1 |
$$& |
The literal text $& |
Each run reports one replacement, even when the visible output stays the same. Doubling the dollar sign prevents the following token from becoming a match reference in these examples. The MDN replacement-pattern reference explains the underlying conventions. The table covers this tool and these tested tokens; do not assume it implements every replacement feature described for JavaScript.
Check the scope before replacing all matches
A literal search still replaces every matching symbol when Replace all is on. A dollar sign in a variable, template or unrelated currency label would also qualify. Work on the intended plain-text section rather than applying the edit across source code or structured records.
Keep an original copy, confirm the replacement count and inspect one changed item and one unchanged item. Use the Text Compare tool for a larger review. For ordinary word edits, the whole-word replacement guide covers the separate question of matching part of a word.