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.
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)
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 a regex pattern like `(?:^|,)("(?:[^"]+|"")*"|[^,]*)` to handle quoted fields properly. The tool returns an array where each element is a field, preserving quoted content.
Regex split uses pattern matching for complex delimiters (whitespace, multiple characters, conditional splits), while string split only works with exact character matches.
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.
Yes, empty strings are included when the pattern matches consecutive delimiters or appears at the beginning/end of the input text.
Use patterns like `\s+` for any whitespace sequence or `\b` for word boundaries. The tool handles Unicode whitespace and complex boundary conditions consistently.