>Fafa Dev Tools

Find and Replace

Find and replace text with support for case-sensitive, whole word, and regex matching. Free online find and replace tool with live preview.

0 chars
Output will appear here...

What is Find and Replace?

Find and replace is a text operation that searches for specific text patterns and replaces them with new text. This tool supports three matching modes: literal text (exact match), case-insensitive matching, whole word matching, and regular expressions (regex). It's useful for batch renaming, reformatting data, cleaning up text, and code refactoring.

How to Use

  1. Enter the text to find in the 'Find' field
  2. Enter the replacement text in the 'Replace with' field
  3. Toggle options: case sensitive, whole word, or regex mode
  4. Click 'Apply to Input' to replace matches directly in the input text

Examples

Replace a word

InputFind: fox | Replace: cat | Text: The quick brown fox
OutputThe quick brown cat (1 replacement)

Regex replace digits

InputFind: \d+ | Replace: [NUM] | Regex: on | Text: Order 123 has 5 items
OutputOrder [NUM] has [NUM] items (2 replacements)

Frequently Asked Questions

What does 'whole word' matching mean?

Whole word mode adds word boundary checks so 'cat' matches only the standalone word 'cat', not 'category' or 'concatenate'. It uses \b word boundaries in regex. Useful for replacing variable names without affecting longer identifiers.

Can I use regular expressions?

Yes. Enable the Regex checkbox to use regex patterns in the Find field. You can use capture groups like (\w+) and reference them in the replacement with $1, $2, etc. Invalid regex patterns will show an error message.

What does 'Apply to Input' do?

Clicking 'Apply to Input' permanently replaces the matches in your input text. This is useful for iterative find-and-replace operations where you want to chain multiple replacements. The output preview always shows what the result would look like.