Regular Expressions 101

Community Patterns

IPV6 validator

0

Regular Expression
PCRE (PHP <7.3)

`
^ (?(DEFINE) (?<hex4>[0-9A-Fa-f]{1,4}) (?<hex4_>(?&hex4):) (?<_hex4>:(?&hex4)) (?<byte> (25[0-5])|(2[0-4]\d)|(1\d{2})|([1-9]\d)|\d ) (?<ipv4> ((?&byte)\.){3}(?&byte) ) ) (((?&hex4_){7}(?&hex4)) |((?&hex4_){5}(?&_hex4)) |((?&hex4_){4}(?&_hex4){1,2}) |((?&hex4_){3}(?&_hex4){1,3}) |((?&hex4_){2}(?&_hex4){1,4}) |((?&hex4_){1}(?&_hex4){1,5}) |(:(?&_hex4){1,6}) |((?&hex4_){1,6}:) |((?&hex4_){6}(?&ipv4)) |((?&hex4_){3}(?&_hex4):(?&ipv4)) |((?&hex4_){2}(?&_hex4){1,2}:(?&ipv4)) |((?&hex4_){1}(?&_hex4){1,3}:(?&ipv4)) |((?&hex4_){1,4}:(?&ipv4)) |(:(?&_hex4){0,4}:(?&ipv4)) )$
`
gmx

Description

no description available

Submitted by olivier.parmentier - 6 years ago