iMapper Community

IPv6 addresses are considerably more complicated to parse than the more familiar IPv4 address. Consequently, it's useful to have a standard tool for determining whether they are correctly formatted or well-formed.

A while back, Stephen Ryan from Dartware created a regular expression (regex) for validating whether IPv6 addresses are well-formed. We posted the regex as an article A Regular Expression for IPv6 Addresses in the InterMapper Knowledgebase.

We subsequently received a contribution from "Aeron" with a different regex that pointed out a bug in our earlier one. We have updated the InterMapper Knowledgebase to include the corrected version of Stephen's regex as well as Aeron's expression. Both these regular expresssions and a program to run through test cases are implemented in the Perl language.

We recently received a note from Christoph Petschnig who has translated the regex to the Ruby programming language. His version can be found on his GIT repository at http://gist.github.com/294476.

We're interested in collecting other implementations and/or test cases -- if you have one, please send me an e-mail and we'll post it too! Thanks.

Rich

Tags: IPv6 validator, format, ipv4, ipv6, parser, regex, regular expression, valid, well-formed

Comment

You need to be a member of iMapper Community to add comments!

Join iMapper Community

© 2010   Created by Community Admin | Dartware, LLC develops the InterMapper® network monitoring software with an integrated NetFlow analyzer. InterMapper network management software earns a quick return on investment by proactively alerting administrators to potential slow-downs, crashes, and other business interruptions. Its real-time, color-coded maps and other displays provide users with an instant view of their network including device status and bandwidth usage. Dartware's software is installed in financial services, healthcare, retail, education, government, non-profit, WISP and ISP organizations around the world.

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

InterMapper.com iMapper Community