Find and Replace
Replace a literal string, or a regular expression, across the whole text.
About this tool
Literal matching does not treat dots or stars as operators. Turn that mode off when you want a regular expression, and the page compiles it as JavaScript.
An invalid pattern is reported. The original text stays available so you can correct the pattern.
How to use it
- Paste the text and the search text.
- Leave literal matching on, or turn it off to use a JavaScript regular expression.
- Replace. Every match in the text is updated.
Limitations
- Literal mode searches for the characters you typed. Regular-expression mode uses JavaScript syntax and can fail when the pattern is invalid.
- The replacement is the whole text, not a single line unless the pattern says so.
Literal text or a JavaScript pattern
Literal mode is the safe default
With literal matching on, the find box is characters, not a pattern. A dot matches a dot. A star matches a star. Every non-overlapping occurrence is replaced, including matches that sit in the middle of a word, because there is no whole-word switch. An empty find string does nothing, so you cannot accidentally insert the replacement between every character. The replacement is inserted as text. It is not re-scanned for further matches.
Turning literal matching off
Off means the find box is a JavaScript regular expression, built with the global flag. A broken pattern fails rather than replacing nothing quietly. Replacement text can use the usual JavaScript substitution patterns, so a capture group is available if you wrote one. That power is also how a short pattern deletes more than you meant. Anchor with ^ or $ when you mean a whole line. Without anchors, the pattern runs across the whole paste as one string, and a newline is just another character unless your pattern accounts for it.
One result, not a preview of each hit
The page returns the whole text after every match is replaced. It does not list the matches beside the text, and it does not replace only the first hit unless your pattern and the way you run it produce only one. If you needed a count of hits without editing, this is the wrong page. A regex tester shows matches. This page edits.
Overlap and the global flag
Matches do not overlap. A pattern that could start inside a previous match waits until after that match. Literal mode has the same left-to-right, non-overlapping behavior. If you need overlapping hits counted, this editor is the wrong tool. Replace once, read the result, and run again only if a new match appears that the first pass created on purpose.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

