Find and Replace
Find and replace text with full regex support, capture groups, and live match preview. 100% client-side.
👁 Live Preview (matches highlighted)
4 matches✨ Result (after replacement)
Contact us at [EMAIL] or [EMAIL]. Our phone numbers: 555-123-4567 and 555-987-6543. Visit https://codekeet.com for details. Order #12345 was placed on 2026-09-29. Order #67890 was placed on 2026-09-30. Emails: [EMAIL], [EMAIL]
About Find and Replace
Find and replace is one of the most-used operations in text editing — whether you are renaming variables, cleaning up copy-pasted data, reformatting logs, or fixing typos in bulk. When simple text replacement is not enough, regex (regular expressions) unlocks powerful patterns: replace all dates in a specific format, swap first and last names, reformat phone numbers, or remove duplicate whitespace. This tool supports both plain-text and full regex find/replace, with backreferences ($1, $2, $<name>) for capture groups, all JavaScript flags, case-sensitivity, and live match preview. You always see exactly what will change before you apply it. Everything runs in your browser.
How It Works
- Enter your text in the top box.
- Enter a search pattern (plain text or regex).
- Enter the replacement string — use $1, $2 for capture groups, $& for the full match.
- See all matches highlighted and a live count of replacements.
- Click "Replace All" to apply and view the result.
✨ Key Features
- ✓Plain text find and replace
- ✓Full regex support (JavaScript regex engine)
- ✓Capture groups with backreferences ($1, $2, $<name>)
- ✓Flags: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), y (sticky)
- ✓Live match highlighting
- ✓Match count display
- ✓Replace with "$&" for the full match
- ✓Replace with "$$" for a literal $
- ✓Whole-word matching option
- ✓Preview before applying
- ✓100% client-side — no data sent to any server
🎯 Common Use Cases
- →Renaming variables in code across a file
- →Reformatting dates, phone numbers, or currency
- →Swapping first and last names
- →Removing extra whitespace or blank lines
- →Cleaning up copy-pasted text with HTML tags
- →Standardizing capitalization in lists
- →Fixing common typos in bulk
- →Preparing data for import into a database
💡 Advanced Tips & Pro Insights
- ▸Use $1, $2, $3 for numbered capture groups. $& inserts the full match. $<name> for named groups.
- ▸To replace a literal "$", write "$$" in the replacement. Otherwise "$" is interpreted as a backreference.
- ▸For simple literal searches, keep "Regex" off — this avoids special characters (., *, +, ?, etc.) being treated as regex operators.
- ▸Non-greedy matching: use ".*?" instead of ".*" to avoid consuming too much text between delimiters.
- ▸The multiline flag (m) makes "^" and "$" match the start/end of each line, not the whole string. The dotall flag (s) makes "." match newlines.