Regex Utilities

Get Ipv6 Pattern

Returns a regex pattern for validating IPv6 addresses in various formats. Access via MCP in Cursor or Windsurf, or GET /v1/regex/pattern/ipv6 REST endpoint. Example output: `^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$` for full format. Handles compressed notation, mixed IPv4/IPv6, and edge cases like `::1`.

API Endpoint

GET /v1/regex/pattern/ipv6

Code Examples

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

Validates full format (8 groups of 4 hex digits), compressed notation with `::`, mixed IPv4/IPv6 addresses, and special cases like loopback `::1` and unspecified `::`.

How do I use the IPv6 regex pattern in my MCP-enabled editor?

Call the tool in Cursor, Windsurf, or other MCP clients to get the pattern, then use it directly in your validation functions or form input constraints.

Does the regex handle IPv6 address compression correctly?

Yes, it properly validates compressed notation where consecutive zero groups are replaced with `::`, including cases like `2001:db8::1` and `::ffff:192.0.2.1`.

What's the difference between this and writing my own IPv6 regex?

This provides a battle-tested pattern that handles all IPv6 edge cases and formats correctly, avoiding common regex mistakes that miss valid addresses or allow invalid ones.

Can I get different IPv6 regex patterns for specific use cases?

This tool returns the comprehensive IPv6 pattern. For stricter validation (like excluding certain formats), you'd combine this with additional logic in your application.

Try Get Ipv6 Pattern Now

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

Get Free API Key