Regex Utilities

Get Uuid Pattern

Returns precise regex patterns for UUID validation across different versions (v1, v4, v5) and formats. Access via MCP in Cursor or Windsurf for instant pattern generation, or hit GET /v1/regex/pattern/uuid directly. Example: gets `^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$` for standard UUID validation. Supports both strict RFC 4122 compliance and common variations.

API Endpoint

GET /v1/regex/pattern/uuid

Code Examples

curl "https://tinyfn.io/v1/regex/pattern/uuid" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/regex/pattern/uuid', {
  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/uuid',
    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 regex pattern do I get for UUID v4 validation?

Returns the standard pattern: `^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$` which enforces the version 4 bit in the correct position and valid variant bits.

How do I use UUID regex patterns with MCP in my AI workflow?

Call the tool from Cursor or Claude Code to get patterns instantly, then use them in your validation logic. Perfect for AI agents building form validators or API input sanitization without regex guesswork.

Does the UUID regex pattern handle case sensitivity?

The default pattern uses lowercase hex digits [0-9a-f]. For case-insensitive matching, use the `(?i)` flag or request the case-insensitive variant which uses [0-9a-fA-F].

Can I get UUID patterns without hyphens for compact formats?

Yes, specify the format parameter to get patterns for hex-only UUIDs like `^[0-9a-f]{32}$` for validation of compact UUID strings without separator hyphens.

What's the difference between strict RFC 4122 and relaxed UUID patterns?

Strict patterns enforce version bits and variant bits exactly per RFC 4122. Relaxed patterns accept any valid hex digits in those positions, useful for legacy systems or non-standard UUID implementations.

Try Get Uuid Pattern Now

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

Get Free API Key