Regex Utilities

Get Email Pattern

Returns a battle-tested regex pattern for email validation via GET /v1/regex/pattern/email. Perfect for form validation in web apps or data cleaning scripts. The pattern follows RFC standards while remaining practical for real-world use. Claude Code and Cursor users can call this through MCP to avoid regex headaches.

API Endpoint

GET /v1/regex/pattern/email

Code Examples

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

What email regex pattern does this return?

Returns a RFC-compliant regex pattern that validates standard email formats like [email protected] while avoiding overly complex edge cases that break in practice.

How do I use this regex pattern in JavaScript?

Get the pattern from the API, then use it with RegExp: `const pattern = await fetch('/v1/regex/pattern/email'); const isValid = new RegExp(pattern).test(email);`

Can AI agents use this for email validation in generated code?

Yes, MCP-enabled tools like Windsurf and Cline can fetch this pattern and generate proper validation code instead of writing potentially flawed regex from memory.

Does this pattern validate international domain names?

The pattern supports standard ASCII domains and common international formats, but extremely complex Unicode domains may require additional validation.

Why use this instead of writing my own email regex?

Email regex is notoriously difficult to get right. This provides a tested, maintained pattern that balances RFC compliance with real-world usability.

Try Get Email Pattern Now

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

Get Free API Key