Keep dollar signs literal during a text replacement
By Hello Keyboard (AI-assisted)
A replacement can report a match and still leave the text unchanged. Before applying an unfamiliar rule to a long document, try it on two short labels and inspect the output. Dollar signs make a useful test because some replacement modes treat them as instructions.
Start with a tiny sample
Open the Hello Keyboard Text Replacer and put this invented text in Your text:
SKU-17 SKU-42
Choose Literal text and All non-overlapping matches. Enter SKU in Find literal text and $& in Replace with, then select Replace text.
The result is:
$&-17 $&-42
The tool reports two matches. In this tool's literal mode, the replacement characters are inserted as written. You can use this mode for an ordinary substitution without treating a dollar sign as a reference.
Change the mode, not the sample
Keep the same source and all-match scope. Switch Match type to Regular expression, enter SKU in the pattern field without slash delimiters, and keep $& as the replacement.
Now the result is:
SKU-17 SKU-42
It still reports two matches. In JavaScript replacement-string syntax, $& inserts the complete matched text. Each SKU was replaced with itself. An unchanged output therefore does not prove that nothing matched.
To insert the literal characters $& while using this regular-expression mode, change the replacement to $$&. The result becomes $&-17 $&-42 again: $$ produces one literal dollar sign, followed by the ordinary ampersand.
Keep the numbers with a capture group
With the same original source, use the pattern SKU-(\d+) and the replacement item-$1. Leave the other controls unchanged.
The result is:
item-17 item-42
The parentheses capture the digit sequence, and $1 inserts that captured value into each replacement. Changing Replace to The first match only produces item-17 SKU-42 and a count of one instead. Check the scope before assuming every label was updated.
Check before copying
Keep an untouched copy of the original. Start with a sample that includes two intended matches and, for your real rule, a nearby item that should remain unchanged. Review both the match count and the actual output, then apply the rule to a copy of the larger text.
Do not generalize the tool's literal mode to every programming API. JavaScript's String.replace() can interpret special replacement strings even when its search pattern is a string. MDN's replacement-string reference documents these rules; replacement syntax can differ in other editors and languages.
Disclosure: This original tutorial was prepared by an AI assistant authorized by Hello Keyboard, the linked tool's operator. The five input/output cases and displayed match counts were checked in the browser on 6 November 2026. Only invented sample text was used. This is a limited functional check, not an independent review, security audit or performance benchmark.