⚙ Text Mechanic

Find and Replace Text

Find and replace text or regular expressions across multiple lines with real-time occurrence counting, case sensitivity, and multi-line matching. 100% private.

How to Use Find and Replace Text

  1. Paste Input: Paste the source text into the editor.
  2. Enter Query & Replacement: Specify the text or regex pattern to search for and the text to replace it with.
  3. Configure Options: Toggle Case Sensitive, Match Whole Word, or Regular Expression modes.

Key Features & Capabilities

  • Full RegEx Support: Use standard JavaScript regular expressions with capture group substitutions ($1, $2).
  • Live Match Counter: See exactly how many occurrences were replaced in real time.
  • Diff Compare: Inspect replaced terms visually in the integrated diff viewer.
  • 100% In-Browser Privacy: Your text never leaves your device or touches an external server.

Common Use Cases

  • Code Refactoring: Batch rename variables, URLs, or function names across raw code snippets.
  • Template Substitution: Replace placeholders like `{{name}}` or `{id}` with concrete values.

Frequently Asked Questions

Does this tool support regex capture groups?
Yes! You can use capture groups like (\w+) in the find box and $1 in the replacement box.
Is find and replace case-sensitive by default?
You can easily toggle case sensitivity with the Case-Sensitive checkbox.

Related Text Utilities

Regex Pattern Extractor
Extract all occurrences or capture groups matching a regular expression
Remove Lines Containing...
Filter out or retain only lines containing a specific keyword or regex pattern
Remove Empty Lines & Extra Spaces
Strip consecutive spaces, tabs, empty lines, and trailing whitespace
Letter Case Converter
Convert between UPPERCASE, lowercase, Title Case, camelCase, snake_case, and more