Skip to content
AgileLogics

Find & Replace

Finds every occurrence of a search term in your text and replaces it with new content, with optional case-sensitivity and regular-expression matching.

How it works

Paste your text, enter what to find and what to replace it with, and click Convert.

What is find and replace?

Find and replace searches a block of text for a word, phrase or pattern and swaps every occurrence for something else. This tool works on whatever you paste: it replaces all matches at once, ignores case unless you tell it not to, and can treat the search as a JavaScript regular expression for pattern-based edits such as reformatting dates or stripping whitespace.

How to find and replace

  1. Paste your text into the input box.
  2. Type what to look for in Find, and the new text in Replace with. Leave Replace with empty to delete the matches.
  3. Tick Case sensitive or Treat "Find" as a regular expression if you need them.
  4. Click Convert and copy the result.

If Find is empty, the text comes back unchanged.

Worked example: plain text

Input: Color, color, COLOR. The colour of the colorful sky.

Find Options Result
color none shade, shade, shade. The colour of the shadeful sky.
color Case sensitive Color, shade, COLOR. The colour of the shadeful sky.
\bcolou?r\b Regular expression shade, shade, shade. The shade of the colorful sky.

The first row shows the two usual surprises: all three capitalizations become lowercase shade, and colorful turns into shadeful because the search matches inside words. The regex in the third row fixes both problems for this case. \b limits it to whole words, and u? makes the u optional so the British spelling is caught too.

In plain mode, characters like ., ( and * are matched literally. Finding 5.00 (approx.) replaces exactly that text, and finding . in a.b.c gives a-b-c. Switch on regex mode with the same . and every character is replaced, giving -----, since . means "any character" in a regular expression.

The replacement is literal in plain mode too. Replacing 10 with $10 in Price: 10 gives Price: $10, and $& or $1 typed into Replace with comes out as those exact characters.

Using regular expressions

With the regex option on, Find is compiled as a JavaScript RegExp and the result comes from String.prototype.replace(). The replacement can refer back to what was matched:

In Replace with Inserts
$1, $2 ... The text captured by group 1, 2 ...
$<year> The text captured by a named group (?<year>...)
$& The whole match
$$ A literal dollar sign

Some patterns that are useful on everyday text:

Task Find Replace with
Reorder dates (2026-10-05 to 05/10/2026) (\d{4})-(\d{2})-(\d{2}) $3/$2/$1
Swap "First Last" to "Last, First" on every line ^(\w+) (\w+)$ $2, $1
Remove indentation from every line ^\s+ leave empty
Collapse runs of spaces {2,} a single space
Join lines with commas \n ,
Replace the shortest tag pair, not the longest <b>.*?</b> your text

The last row matters because * is greedy: in <b>x</b> and <b>y</b>, the pattern <b>.*</b> matches everything from the first <b> to the last </b> as one match. Adding ? makes it stop at the first closing tag, so both pairs are replaced separately. If you're building a pattern, check what it matches in the regex tester before replacing anything.

Limits worth knowing

  • ^ and $ match at the start and end of each line. The pattern is compiled with the g and m flags (plus i when Case sensitive is off), so ^(\w+) (\w+)$ turns Ada Lovelace and Alan Turing on separate lines into Lovelace, Ada and Turing, Alan. There's no option to anchor to the start of the whole text only; paste just the part you want changed instead.
  • . doesn't match line breaks. Use [\s\S] when a match has to span lines.
  • The replacement can't contain a line break. Replace with is a single-line box, and typing \n there inserts a backslash and the letter n. To split text onto separate lines, do that step in a text editor.
  • $ is only special in regex mode. There, $& inserts the match and $$ becomes a single $. In plain mode every $ is kept as typed, so replacing 10 with $$10 gives $$10.
  • Replacements don't keep the original case. Replacing apple with pear turns Apple into pear. Fix capitalization afterwards with the case converter if it matters.

Related tools

  • Regex tester: see every match and capture group before you replace.
  • Remove Duplicate Lines: after cleaning stray whitespace here, drop repeated lines.
  • Text sorter: put the cleaned list in order.
  • Code diff: compare the text before and after to review exactly what was replaced.

Last updated

Frequently asked questions

Does it replace every match or only the first one?
Every match. The search runs over the whole text and replaces all occurrences in one go, so there's no need to click more than once.
Is the search case-sensitive?
Not by default. With Case sensitive unticked, finding color also replaces Color and COLOR, and every match gets your replacement text exactly as you typed it. Tick Case sensitive to replace only exact-case matches.
Why did it replace part of a longer word?
A plain search matches anywhere, including inside other words, so replacing cat also changes category. Tick the regular expression option and wrap the word in \b, as in \bcat\b, to match whole words only.
How do I delete text instead of replacing it?
Leave the Replace with box empty. Every match is removed.
Can I use capture groups in the replacement?
Yes, in regular expression mode. $1, $2 and so on insert the text matched by each group, $<name> inserts a named group, and $& inserts the whole match. For example, finding (\d{4})-(\d{2})-(\d{2}) and replacing with $3/$2/$1 turns 2026-10-05 into 05/10/2026. In plain mode the replacement is inserted exactly as typed, dollar signs included.
Is my text uploaded?
No. The replacement runs in JavaScript in your browser, so the text never leaves your device.