Categories

Regex Replace Previewer

Preview regex replacements in real-time with detailed diff highlights and statistics

**Features:** - Real-time preview of text replacements - Support for capture groups ($1, $2, ${name}) - Special patterns: $& (full match), $` (prefix), $' (suffix), $$ (literal $) - Diff highlights showing changes - Detailed statistics on replacements **Example Usage:** Pattern: `\b(\d{4})-(\d{2})-(\d{2})\b` Replacement: `$2/$3/$1` Input: "Dates: 2024-01-15 and 2024-02-20" Output: "Dates: 01/15/2024 and 02/20/2024"

Enter the regular expression pattern to search for

Use $1, $2, ${name} for capture groups. Special: $& (match), $` (prefix), $' (suffix), $$ (literal $)

Regex flags: g (global), i (case-insensitive), m (multiline), etc.

Choose how to display the replacement preview

API Documentation

Request Endpoint

POST /en/api/tools/regex-replace-previewer

Request Parameters

Parameter Name Type Required Description
textInput textarea Yes -
pattern text Yes Enter the regular expression pattern to search for
replacement text Yes Use $1, $2, ${name} for capture groups. Special: $& (match), $` (prefix), $' (suffix), $$ (literal $)
flags text No Regex flags: g (global), i (case-insensitive), m (multiline), etc.
previewMode select No Choose how to display the replacement preview

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-regex-replace-previewer": {
      "name": "regex-replace-previewer",
      "description": "Preview regex replacements in real-time with detailed diff highlights and statistics",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=regex-replace-previewer",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]