Regex Utilities

Find All Matches

Extracts all pattern matches from text using regex, returning positions and captured groups. Use via MCP in Cursor or Windsurf, or call GET /v1/regex/find-all directly. Perfect for parsing logs, extracting emails, or finding repeated structures. Returns deterministic results with match indices and group captures.

API Endpoint

GET /v1/regex/find-all

Code Examples

curl "https://tinyfn.io/v1/regex/find-all" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/regex/find-all', {
  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/find-all',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I find all email addresses in a text block?

Use pattern `[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}` with your text. Returns array of matches with positions and the full email strings.

What's returned when using find-all in MCP tools like Claude Code?

JSON array with each match containing the matched text, start/end positions, and any captured groups from parentheses in your regex.

Can I extract multiple capture groups from each match?

Yes, use parentheses in your pattern. Each match returns an array of captured groups plus the full match text.

Does find-all work with multiline text and complex patterns?

Absolutely. Supports all standard regex flags including multiline, case-insensitive, and global matching across large text blocks.

How is this different from a simple regex search?

Returns ALL matches with precise positioning data, not just the first match. Essential for parsing structured data or counting occurrences.

Try Find All Matches Now

Get your free API key and start using Find All Matches in seconds.

Get Free API Key