Regular expression that matches valid IPv6 addresses

I’m having trouble writing a regular expression that matches valid IPv6 addresses, including those in their compressed form (with :: or leading zeros omitted from each byte pair).

Can someone suggest a regular expression that would fulfill the requirement?

I’m considering expanding each byte pair and matching the result with a simpler regex.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)