Extracts named and numbered capture groups from regex pattern matches. Use via MCP in Cursor or Windsurf, or call GET /v1/regex/groups with your text, pattern, and optional flags. Returns structured JSON with group names, values, and positions. Perfect for parsing structured data like emails, URLs, or log entries where you need specific parts extracted.
curl "https://tinyfn.io/v1/regex/groups" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/regex/groups', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/regex/groups',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's regex tools:
{
"mcpServers": {
"tinyfn-regex": {
"url": "https://tinyfn.io/mcp/regex",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Use named groups like (?P<name>pattern) in your regex. The tool returns both named groups and their numbered equivalents in the response JSON.
Numbered groups use parentheses (pattern) and are indexed starting at 1. Named groups use (?P<name>pattern) syntax and can be accessed by name or number.
This tool extracts groups from the first match only. For multiple matches across a text, you'd need to call it multiple times or use a global search tool first.
MCP clients receive structured JSON with group names, values, start/end positions, making it easy for AI agents to parse and use the extracted data in code generation.
The tool returns an empty groups object. Only parenthesized expressions create capture groups—the overall match isn't considered a group.
Get your free API key and start using Extract Groups in seconds.
Get Free API Key