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 Pattern | Replace With | Effect |
|---|---|---|
\s+ | | Collapse multiple spaces to one |
^ | - | Add bullet to start of every line |
(\d{4})-(\d{2})-(\d{2}) | $3/$2/$1 | Reformat YYYY-MM-DD to DD/MM/YYYY |
https?://[^\s]+ | [link] | Replace all URLs with placeholder |
+ | | Remove double spaces |
\n{3,} | \n\n | Collapse 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.
Related Tools
- Regex Tester — test and debug your regex pattern before applying
- Remove Extra Spaces — dedicated tool for whitespace cleanup
- Text Diff Checker — compare original vs replaced text