Regex Utilities

Regex Split

Split text into arrays using regex patterns with guaranteed accuracy. Access via MCP in Cursor or Windsurf, or REST API at `/v1/regex/split`. Split CSV rows by commas, extract words from sentences, or parse structured data. Returns consistent string arrays, eliminating regex engine differences across programming languages.

API Endpoint

GET /v1/regex/split

Code Examples

curl "https://tinyfn.io/v1/regex/split" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/regex/split', {
  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/split',
    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 split a CSV line with quoted fields containing commas?

Use a regex pattern like `(?:^|,)("(?:[^"]+|"")*"|[^,]*)` to handle quoted fields properly. The tool returns an array where each element is a field, preserving quoted content.

What's the difference between regex split and string split?

Regex split uses pattern matching for complex delimiters (whitespace, multiple characters, conditional splits), while string split only works with exact character matches.

Can MCP tools like Claude Code use this for parsing log files?

Yes, AI agents can split log entries by timestamp patterns, extract fields from structured logs, or parse multi-line records using regex patterns through the MCP interface.

Does the split include empty strings in the result array?

Yes, empty strings are included when the pattern matches consecutive delimiters or appears at the beginning/end of the input text.

How do I split on word boundaries or whitespace variations?

Use patterns like `\s+` for any whitespace sequence or `\b` for word boundaries. The tool handles Unicode whitespace and complex boundary conditions consistently.

Try Regex Split Now

Get your free API key and start using Regex Split in seconds.

Get Free API Key