Last active
December 17, 2015 01:58
-
-
Save mjf/5531936 to your computer and use it in GitHub Desktop.
Match lines containing IPv4 private addresses. TODO: aggregate into single regular expression
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
#! /bin/sed -f | |
# 10.0.0.0/8 | |
# 127.0.0.0/8 | |
/1\(0\|27\)\(\.\([0-9]\|[1-9][0-9]\|10[0-9]\|1[1-9][0-9]\|25[0-5]\|2[0-4][0-9]\)\)\{3\}/ p | |
# 172.16.0.0/19 | |
# 192.168.0.0/16 | |
/\(172\.\(1[6-9]\|2[0-9]\|3[0-1]\)\|192\.168\)\(\.\([0-9]\|[1-9][0-9]\|10[0-9]\|1[1-9][0-9]\|25[0-5]\|2[0-4][0-9]\)\)\{2\}/ p | |
d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment