Created
August 24, 2015 21:12
-
-
Save hackingbutlegal/cf4ed2601b7b0fef8157 to your computer and use it in GitHub Desktop.
Regex to match on only valid IPs including local and bcast
This file contains 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
grep -E -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' file.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment