Skip to content

Instantly share code, notes, and snippets.

@rohan-molloy
Created December 19, 2018 12:13
Show Gist options
  • Save rohan-molloy/1704ce77814580126e6df221cfe09940 to your computer and use it in GitHub Desktop.
Save rohan-molloy/1704ce77814580126e6df221cfe09940 to your computer and use it in GitHub Desktop.
Regular Expression for IPv4 Address

Regular Expression for IPv4 Address

grep -E '\b(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment