# Regex Execution and Group Extractor MCP for AI Agents MCP

> Regex Execution and Group Extractor lets you run regular expressions against any text to pull out specific data points, capture groups, or character offsets. It is built for precise pattern matching and string manipulation tasks that require more than just simple searching.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_bqecvs0zwI2Mo0D7mpR9q5WwdocPVl4csBES81nH/mcp
- **Tags:** regex, pattern-matching, string-manipulation, parsing, automation

## Description

If you are working with messy logs or unstructured text, getting exactly the right piece of data is usually a headache. This MCP changes how your agent handles text by providing deterministic results for complex patterns. Instead of guessing where a string starts or ends, you can pull out specific segments, find exact character positions, or even identify specific server directives hidden in tags. It is perfect for parsing structured logs, validating web routes, or finding specific substrings within massive datasets. When you connect this to your favorite client through the Vinkius catalog, you are giving your agent a reliable way to perform precise text manipulation without any ambiguity.

## Tools

### execute_regex
Runs a regular expression against text to return detailed match info. It provides capture groups and offsets.

### detect_islands
Finds tags containing specific server directives in a string. It identifies server:defer or server:only markers.

### extract_substring_indices
Returns the start and end indices for every occurrence of a substring. This is useful for finding exact positions.

### match_route
Compares a path against a pattern and extracts any parameters. It validates web routes effectively.

## Prompt Examples

**Prompt:** 
```
Find all the email addresses in this text block.
```

**Response:** 
```
| Email | Start Index | End Index |
| :--- | :--- | :--- |
| support@vinkius.com | 24 | 43 |
| admin@example.org | 47 | 65 |
```

**Prompt:** 
```
Check if this URL matches our user pattern and tell me the ID.
```

**Response:** 
```
**Match Found**

* **Path:** `/api/users/123`
* **Pattern:** `/api/:id`
* **Extracted Parameters:**
  * `id`: `users/123`
```

**Prompt:** 
```
Where does the word 'hello' appear in this text?
```

**Response:** 
```
The word "hello" was found at the following locations:

1. **Index 0 to 5**
2. **Index 13 to 18**
```

## Capabilities

### Extract pattern matches
Pulls detailed information from regex executions.

### Locate substring positions
Finds every instance of a specific string and its exact index.

### Validate URL paths
Checks if a path matches a route pattern and grabs the parameters.

### Identify content tags
Detects specific server directives within text strings.

### Find character offsets
Returns precise start and end indices for matched data.

## Use Cases

### Parsing messy logs
An engineer needs to pull timestamps from a log file; the agent uses execute_regex to find them all.

### Validating API routes
A developer wants to check if a URL matches a pattern; the agent extracts the ID automatically.

### Finding specific markers
You need to locate every instance of an error code in a document using precise indices.

### Cleaning up HTML tags
An agent needs to find server-specific directives; it identifies them within the text string.

## Benefits

- Eliminate guesswork by using extract_substring_indices to get exact capture groups every time.
- Speed up log analysis with match_route to verify path parameters without manual checks.
- Automate tag parsing by using detect_islands to find server-side directives in your text.
- Get precise character offsets for every match, making it easy to slice and dice large strings.
- Find every instance of a specific string and its exact index instantly.

## How It Works

The bottom line is you get exact, deterministic text extraction instead of fuzzy AI guesses.

1. Connect your preferred AI client to this MCP via Vinkius.
2. Provide the text or path you want to analyze to your agent.
3. Receive structured, precise data like capture groups, indices, or route parameters.

## Frequently Asked Questions

**How can Regex Execution and Group Extractor help with log analysis?**
It automates finding patterns like timestamps or error codes within large text files, providing exact locations for every match.

**Can I use Regex Execution and Group Extractor to validate my web routes?**
Yes, it compares paths against patterns and automatically extracts any parameters present in the URL.

**Does Regex Execution and Group Extractor work for finding specific words in large files?**
It does. It returns the exact start and end positions of every occurrence, making it easy to locate data in massive datasets.

**Is Regex Execution and Group Extractor useful for finding server directives?**
It can detect specific tags like server:defer or server:only within your text strings automatically.

**How does Regex Execution and Group Extractor handle complex patterns?**
It uses standard regex engines to return detailed capture groups, matches, and character offsets for any pattern you provide.

**What can I do with the `execute_regex` tool?**
You can run any valid regular expression against a target string to retrieve an array of matches, including capture groups and their exact start and end character positions.

**How does `extract_substring_indices` work?**
It searches for every occurrence of a specific substring within a larger text and returns the precise character indices (start and end) for each instance found.

**What are 'islands' in the context of `detect_islands`?**
Islands are specific segments of text identified by tags containing `server:defer` or `server:only` directives, which the tool can isolate and report.