Skip to content
T
Tools.Town
Free Online Tools for Everyone
Text Tools

How to Use Find and Replace — Complete Guide

Learn how to find and replace text with plain strings or regex patterns using Tools.Town's free Find and Replace tool.

8 May 2026 4 min read By Tools.Town Team Fact Checked

Key Takeaways

  • Yes — toggle 'Regex mode' to use regular expression patterns in the Find field
  • By default, yes
  • Yes — leave the Replace field empty and click Replace All
  • Yes — all matches are highlighted in the text before you click Replace All, so you can verify what will be changed

What is Find and Replace?

Find and Replace searches a block of text for a string (or regex pattern) and replaces all occurrences with your specified replacement. Handles bulk text edits in seconds that would take minutes to do by hand.

Find and Replace is one of the most powerful text manipulation primitives. With regex mode enabled, a single operation can transform complex patterns across thousands of lines.


Two Modes

Plain Text Mode

Literal string matching. 'hello' matches exactly 'hello'. Simple and safe for most everyday replacements.

Regex Mode

Pattern-based matching. Use capture groups and back-references for complex transformations like reformatting dates.

Case-Insensitive

Toggle to match 'Hello', 'HELLO', and 'hello' all with a single search term.

Match Highlight

All matches are highlighted before replacement so you verify scope before committing.


How to Use Find and Replace

Paste your text

Paste the text you want to edit into the main text area.

Enter search term

Type the string (or regex pattern) you want to find.

Enter replacement

Type the replacement string. Leave empty to delete all matches.

Replace All

Click 'Replace All' to apply. The stats panel shows how many replacements were made.


Regex Replace Examples

Find PatternReplace WithEffect
\s+ Collapse multiple spaces to one
^- Add bullet to start of every line
(\d{4})-(\d{2})-(\d{2})$3/$2/$1Reformat YYYY-MM-DD to DD/MM/YYYY
https?://[^\s]+[link]Replace all URLs with placeholder
+ Remove double spaces
\n{3,}\n\nCollapse 3+ blank lines to 2

Tips & Common Mistakes

In regex replace, use $1 not \1 for back-references. JavaScript regex uses $1, $2 etc. in replacement strings — not \1 as in PCRE/Python. This catches many people who switch between regex flavors.

Verify highlight before replacing. Look at which occurrences are highlighted before clicking Replace All. Regex patterns can match more than you expect — especially patterns using . (matches any character).

Escape special regex characters in literals. If you want to find (price) literally, use \(price\) in regex mode — unescaped, parentheses are group syntax.


Advertisement

Try Find and Replace — Free

Apply what you just learned with our free tool. No sign-up required.

Try Find and Replace

Frequently Asked Questions

Does Find and Replace support regex?
Yes — toggle 'Regex mode' to use regular expression patterns in the Find field. Capture groups in the pattern can be referenced in the Replace field as $1, $2, etc.
Is the replacement case-sensitive?
By default, yes. Toggle 'Case-insensitive' to match all capitalizations of the search term regardless of case.
Can I replace with nothing (delete a string)?
Yes — leave the Replace field empty and click Replace All. Every occurrence of the search term is deleted.
Can I see a preview before replacing?
Yes — all matches are highlighted in the text before you click Replace All, so you can verify what will be changed.

Was this guide helpful?

Your feedback helps us improve our content.

Continue Reading

All Text Tools Guides

Get the best Text Tools tips & guides in your inbox

Join 25,000+ users who get our weekly text tools insights.