Regex Utilities

Test Pattern

Validates regex patterns against text strings, returning true/false match results. Use via MCP in Cursor or Windsurf, or call GET /v1/regex/test with pattern and text parameters. Perfect for form validation, data cleaning, and pattern verification without regex engine inconsistencies across languages.

API Endpoint

GET /v1/regex/test

Code Examples

curl "https://tinyfn.io/v1/regex/test" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/regex/test', {
  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/test',
    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 test if an email regex pattern matches a string?

Send GET request to /v1/regex/test with pattern='^[\w\.-]+@[\w\.-]+\.[a-zA-Z]{2,}$' and text='[email protected]'. Returns boolean match result.

What regex flavor does TinyFn's test pattern tool use?

Uses standard PCRE (Perl Compatible Regular Expressions) flavor, ensuring consistent behavior across different programming environments and AI agents.

Can I use this tool in MCP-enabled editors for regex validation?

Yes, available as MCP tool in Cursor, Claude Code, Windsurf, and other supported editors. AI agents can test patterns without hallucinating regex behavior.

Does the tool handle multiline text and special regex flags?

Supports standard regex flags and multiline text input. Specify flags in your pattern or use the API's flag parameters for case-insensitive or multiline matching.

What's the difference between this and just running regex in my code?

Provides deterministic, language-agnostic results. Eliminates regex engine differences between JavaScript, Python, Java, etc., especially useful for AI-generated validation logic.

Try Test Pattern Now

Get your free API key and start using Test Pattern in seconds.

Get Free API Key