Regular expression that matches valid IPv6 addresses

Posted by Readonly on Stack Overflow See other posts from Stack Overflow or by Readonly
Published on 2008-09-10T05:57:24Z Indexed on 2010/06/08 16:42 UTC
Read the original article Hit count: 183

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about regex

Related posts about networking