This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
//JavaScript RegExp is compatible with Java as a string literal | |
//strict means :: compression will not be allowed for a single 16 bit 0 segment | |
var strictNonPaddedIPv6 = /^(?:(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){7}(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3})|(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){1,6}:|(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){1,5}:(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3})|(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){1,4}:(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:)(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3})|(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){1,3}:(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){2}(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3})|(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){1,2}:(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){3}(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3})|(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:):(?:0(?![0-9a-fA-F])|[1-9a-fA-F][0-9a-fA-F]{0,3}:){4}(?:0(? |