🔍 Find and Replace

📝
Enter the text you want to search within and modify
🔍
The text or pattern to search for in the input
🔄
The text to replace matches with (leave empty to delete)
⚙️
⚡
📤
{{ result }}
ℹ️
No matches found for the search term. The text remains unchanged.
📊
Found
{{ stats.matches.found }}
Replaced
{{ stats.matches.replaced }}
Remaining
{{ stats.matches.remaining }}
📈
Before:
Length: {{ stats.original.length }}
Words: {{ stats.original.words }}
Lines: {{ stats.original.lines }}
After:
Length: {{ stats.result.length }}
Words: {{ stats.result.words }}
Lines: {{ stats.result.lines }}
🏷️
Find:"{{ options.findText }}"
Replace:"{{ options.replaceText }}"
Case Sensitive: {{ options.caseSensitive ?'Yes' :'No' }}
Use Regex: {{ options.useRegex ?'Yes' :'No' }}
Replace All: {{ options.replaceAll ?'Yes' :'No' }}
💡
Simple Replace:
Find:"Hello" → Replace:"Hi"
Result: Changes all"Hello" to"Hi"
Regex Pattern:
Find:"\\d+" (with regex enabled) → Replace:"NUMBER"
Result: Replaces all numbers with"NUMBER"
Case Insensitive:
Find:"hello" (case insensitive) → Replace:"Hi"
Result: Matches"Hello","HELLO","hello", etc.
⚠️ {{ error }}
🔄 Processing find and replace...

ℹ️ About Find and Replace Tool

Find and Replace Tool searches text for a literal string or an ECMAScript regular expression and rewrites each match with replacement text. Use it for quick edits, batch cleanup, code snippets, logs, CSV fragments, pasted notes, and any plain-text content where a full editor or script would be too much overhead.

Common uses:

  • Replace product names, variable names, placeholders, or repeated phrases across a text block.
  • Normalize messy whitespace, separators, prefixes, suffixes, or copied table data before pasting elsewhere.
  • Use regex patterns to update dates, IDs, tags, quoted strings, or other repeated text structures.
  • Preview how many matches were found and whether only the first match or every match was changed.

Examples: find staging.example.com and replace it with api.example.com to update environment URLs, or enable regex and replace \s+ with a single space to collapse repeated whitespace. Replacement follows JavaScript String.prototype.replace behavior, so capture-group references such as $1 can be useful when the pattern contains groups.

Search modes:

  • Literal text: treats characters such as ., *, and ? as ordinary text.
  • Regular expressions: uses JavaScript regex syntax for character classes, anchors, alternation, and groups.
  • Case sensitivity: toggles exact-case matching instead of case-insensitive matching.
  • Replace first or all: changes only the first match or every match in the input.

Limitations: regex support depends on JavaScript regex semantics, not PCRE, POSIX, or editor-specific dialects. Very large inputs or complex patterns can be slow, and ambiguous nested regex patterns can trigger catastrophic backtracking. The browser interface processes text locally, but API requests send input to the server endpoint, so avoid submitting secrets unless that is acceptable for your workflow.

API Usage Example:

POST /api/tools/text/find-replace
Content-Type: application/json

{
    "text": "Hello World! This is a Hello test.",
    "findText": "Hello",
    "replaceText": "Hi",
    "caseSensitive": false,
    "useRegex": false,
    "replaceAll": true
}
Ready