Created
March 24, 2015 16:07
-
-
Save geraintwhite/c7834873bcc31a311b8a to your computer and use it in GitHub Desktop.
ipv4 and ipv6 regex
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
var ipv4 = /^((1?\d?\d|2([0-4]\d|5[0-5]))(\.|$)){4}$/; | |
var ipv6 = /^(([0-9a-f]{1,4})(:|$)){8}$/i; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment