Find and Replace

Find and replace text with full regex support, capture groups, and live match preview. 100% client-side.

//g
Use $1, $2 for capture groups · $& for full match · $$ for literal $
4 matches found
273 chars

👁 Live Preview (matches highlighted)

4 matches
Contact us at support@codekeet.com or sales@codekeet.com. 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: admin@codekeet.com, info@codekeet.com

✨ Result (after replacement)

228 chars
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]
🔒 100% private: All processing happens in your browser. Your text never leaves your device.

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

  1. Enter your text in the top box.
  2. Enter a search pattern (plain text or regex).
  3. Enter the replacement string — use $1, $2 for capture groups, $& for the full match.
  4. See all matches highlighted and a live count of replacements.
  5. 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.

Frequently Asked Questions

Is this find and replace tool free?▾
Yes, this find and replace tool is completely free with no signup, email, or usage limits.
Is my data safe?▾
Yes, 100% safe. All processing happens in your browser. Your text is never uploaded to any server.
What are backreferences ($1, $2)?▾
Backreferences let you reuse parts of the matched text in the replacement. $1 refers to the first capture group (parentheses in the pattern), $2 to the second, and so on. $& refers to the full match. $<name> for named groups.
What is the difference between plain text and regex mode?▾
In plain text mode, every character is matched literally — the search is exact. In regex mode, special characters (., *, +, ?, [ ], ( ), etc.) have special meaning, allowing powerful pattern matching.
What do the flags mean?▾
g = global (replace all matches, not just the first). i = case-insensitive. m = multiline (^ and $ match line boundaries). s = dotall (. matches newlines). u = unicode mode. y = sticky.
How do I replace a literal "$"?▾
Use "$$" in the replacement string — that escapes the $ and produces a literal $. Just "$" followed by a number is interpreted as a backreference.
How do I replace a specific word only (not partial matches)?▾
Use word boundaries: \bword\b. The \b asserts a boundary between a word character and a non-word character, so it will not match "words" or "sword", only "word".
Can I use named capture groups?▾
Yes. Define them in the pattern as (?<name>...) and reference them in the replacement as $<name>. Named groups are more readable than numbered ones in complex patterns.