Skip to main content

Find and Replace Text with Regex & Case Matching

Find and replace text across a large block with case matching and regex support, and preview the match count first.

Loading tool…

Your file stays in this browser. Nothing is uploaded.

How Find and Replace Text works

Browser Toolset Find and Replace Text replaces characters, words, or complex regular expressions across text blocks in browser memory. See the match count and the replaced text update live, then copy the result.

How to use this tool

  1. Paste your text into the Source Text area.
  2. Enter the search query or regular expression in the "Find Text / Regex" field.
  3. Enter the replacement text in the "Replace With" field.
  4. Toggle the Case Sensitive or Regular Expression options if you need them.
  5. Every match is replaced live in the Replaced Output box. Click "Copy Result" to copy it.

Common uses

  • Updating outdated company brand names across legal disclaimers.
  • Refactoring variable names across source code snippets.
  • Cleaning messy OCR text and correcting recurring transcription typos.
  • Reformatting markdown links and markdown header tags in bulk.

Frequently asked questions

Does Find and Replace support regular expressions (Regex)?

Yes. Tick Regular Expression (Regex) to use a JavaScript pattern in the Find field, with $1-style references in Replace With. Invalid patterns show an error message. Case Sensitive is off by default and every match is replaced.

Can I match whole words only?

There is no Whole Word checkbox. Turn on Regular Expression and wrap your search in word boundaries, for example \bcat\b, so 'cat' does not match inside 'catalog' or 'scatter'.

Are my draft manuscripts or documents uploaded to servers?

No. Replacement runs in your browser and your text is not uploaded. Live replacement is limited to 1,000,000 characters of source text, and nothing is saved by the page, so copy the result before closing.

Can I replace newline characters and tabs?

Partly. In regex mode, use \n and \t in the Find field to match newlines and tabs. The Replace With field is plain text, so typing \n there inserts a backslash and an n, not a line break.

Does it show how many matches were found and replaced?

Yes. A live counter beside the Find field shows how many matches were found, and the replaced text appears in the output box at the same time. Every match is replaced, not only the first, and Copy Result takes the output.

Details and limits

Batch editing long articles or source files manually leads to missed terms and inconsistencies. Our Find and Replace Text utility lets you run multi-line and regex-powered substitutions with a live preview. Your text is edited in your browser and is not uploaded.

Where matching runs and how long text is handled

Searching and replacing happen in your browser while you type, and your text is never sent anywhere. The left box is the source and is never changed. The replaced version appears in the read-only box on the right, a match count sits above the Find field, and Copy Result copies the right-hand text. There is no replace button and no replace-next step: every match is replaced at once.

Plain-text mode is the default and matches exactly what you type, so characters such as . * ( or $ are searched literally and a $ in the replacement stays a $. Regular Expression mode runs the pattern in a background worker with a time limit of 1.5 seconds, after a short pause in typing. A pattern that is too slow stops with a message asking you to simplify it, and a browser without background workers does not run the pattern at all.

Features and limits

  • There are two checkboxes: Case Sensitive, which is off by default, and Regular Expression. There is no whole-word option. In regular expression mode write \bcat\b to match the word cat only.
  • In regular expression mode the replacement understands $1 and $2 for capture groups, $& for the whole match, $<name> for named groups and $$ for a literal dollar sign. The pattern syntax is JavaScript's.
  • Only the global and ignore-case flags are used. With no multiline flag, ^ and $ match only the very start and end of the whole text, and a dot does not match a line break. Use \n or [\s\S] in the pattern to work across lines.
  • Both fields are single-line inputs. You can search for a line break with \n in regular expression mode, but you cannot type one into the replacement, and \n there is inserted as a backslash followed by n.
  • Live replacement stops above 1,000,000 characters in the source box. The tool shows a message and leaves the text unchanged. An empty Find field replaces nothing, and an invalid pattern shows the browser's error message under the field.

Tips and common problems

Check the match count before you copy. A pattern that can match nothing, such as a*, counts every empty position as a match, so the number looks far too high. Use a+ or anchor the pattern.

Case-insensitive matching changes only what is found. The replacement is inserted exactly as typed, so replacing cat with dog turns Cat into dog, not Dog.

For a pattern you are still working out, build it in the Regex Tester & Debugger, which lists each match, and paste it here when it behaves. The Text & Code Diff Checker shows what changed between source and result.