Literal is the default, and that is the whole difference from the Regex Tester. Somebody searching for a.b means a.b — not axb. A tool that quietly treats your search as a pattern does something surprising the first time punctuation is involved.
There is one trap almost nobody knows about: a $ in the REPLACEMENT. String.replace reads $& and $1 in the replacement even when the search was plain text — so replacing a price with "$5" inserts the matched text instead. In literal mode the replacement is escaped too, which almost no find-and-replace tool on the web does.
And the preview is the point. A replace with no preview is a destructive operation performed blind.
Not unless you ask it to. Searching for a.b finds a.b and not axb; searching for $5.00 or (draft) or c:\path finds exactly those. Most people wanting to replace something want to replace that exact thing, and a tool that quietly treats the input as a regular expression does something surprising the first time punctuation is involved.
It should not here, and this is the trap worth knowing about. JavaScript’s replace reads $& , $1 and a couple of other sequences inside the REPLACEMENT string, even when the search was a plain string — so replacing with “$5” can insert the matched text instead of a price. This page escapes the replacement in literal mode, which almost no find-and-replace tool on the web does. Switch to pattern mode if you actually meant $1 as a group reference.
Because whole word puts \b around the term, and \b sits between a word character and a non-word one. If your term itself begins or ends with punctuation — (draft), -5, a trailing comma — there is no boundary there to anchor to. That is what \b means rather than a fault in this page, and it says so when it sees that case.
That is the point of the preview. Every match is listed with its line number and what it will become, before you copy anything out. A replace with no preview is a destructive operation performed blind.
Leave the replacement empty. Every match is removed and the preview shows each one marked as removed rather than silently vanishing.
No. Everything happens in your browser and nothing is transmitted or stored.
$& means "the matched text". Doubling every $ is the whole fix.
It puts \b at each end, and \b sits between a word character and a non-word one. If the term itself begins or ends with punctuation, there is no boundary there to anchor to. That is the definition, not a fault.
Runs entirely in your browser; nothing is transmitted. Literal mode escapes both the search and the replacement, so a $ or a bracket means itself — switch to pattern mode deliberately when you want them to mean something else. Nothing you type here is sent to our servers — the calculation runs entirely in your browser.