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`.
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)
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"
}
}
}
}
Validates full format (8 groups of 4 hex digits), compressed notation with `::`, mixed IPv4/IPv6 addresses, and special cases like loopback `::1` and unspecified `::`.
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.
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`.
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.
This tool returns the comprehensive IPv6 pattern. For stricter validation (like excluding certain formats), you'd combine this with additional logic in your application.
Get your free API key and start using Get Ipv6 Pattern in seconds.
Get Free API Key