Find and Replace Text
The Find and Replace tool searches for text patterns and replaces them with new text. It supports simple text replacement and regular expression patterns, making it powerful for complex text transformations. This tool is essential for bulk editing, data cleaning, code refactoring, and any task that requires finding and replacing text across a document. It shows a count of replacements made and highlights the changes.
Formula
Find and Replace options: - Simple text: exact match replacement - Regex: pattern-based replacement - Case sensitive: match exact case - Case insensitive: match any case - Replace all: all occurrences - Count: number of replacements Regex: use $1, $2 for capture groups
Example
Input: The cat sat on the mat. Find: cat Replace: dog Output: The dog sat on the mat. Replacements: 1 Regex find: \d+ Replace: # Input: Hello 123 World 456 Output: Hello # World #
How to Use
- Paste your text into the input field
- Enter the text or regex pattern to find
- Enter the replacement text
- Choose case sensitivity and match options
- Click replace and review the changes
Frequently Asked Questions
What is the difference between simple and regex find?
Simple find matches exact text (case-sensitive or insensitive). Regex find uses regular expressions for pattern matching, allowing you to find variable text like numbers, emails, or repeated patterns. Use regex for complex searches.
How do I use capture groups in replacement?
Use parentheses in your regex to create capture groups, then reference them with $1, $2, etc. in the replacement. For example, find '(\w+)@(\w+)' and replace with '$2.$1' swaps the parts of an email-like pattern.
Can I replace across multiple lines?
Yes. The tool searches the entire text, including across line breaks. For regex, use the 's' flag (dotall) to make the dot match newlines, or use \n explicitly in your pattern.
How many replacements can be made?
There is no limit. The tool replaces all occurrences by default. You can also choose to replace only the first occurrence or a specific number of occurrences. The tool shows the total count of replacements made.
Is the find and replace reversible?
The tool shows the original and modified text side by side. You can copy the result or undo by clicking the original text. However, the tool does not save history, so always keep a backup of your original text.