Replace text patterns using regular expressions with deterministic results. Available via MCP in Cursor and other AI editors, or REST API at /v1/regex/replace. Pass your text, regex pattern, and replacement string — get consistent output every time. Supports global replacements and capture groups for complex text transformations.
curl "https://tinyfn.io/v1/regex/replace" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/regex/replace', {
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/replace',
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 pattern `[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,}` with replacement `[REDACTED]`. The tool will find and replace all email matches globally.
Yes, use parentheses in your pattern like `(\d{4})-(\d{2})-(\d{2})` and reference groups in replacement with `$2/$3/$1` to transform dates from YYYY-MM-DD to MM/DD/YYYY format.
The tool returns an error with details about the invalid pattern. Always test complex regex patterns first with simpler text to verify syntax.
AI agents in Cursor or Windsurf can chain regex replace operations to clean datasets — remove phone number formatting, standardize dates, or sanitize user input reliably.
The tool follows standard regex behavior. Use inline flags like `(?i)pattern` in your regex to enable case-insensitive matching for specific patterns.
Get your free API key and start using Regex Replace in seconds.
Get Free API Key