Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Regex to validate (IPv4) CIDR notation (with capture)
\b(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]?)/(3[0-2]|[1-2]?[0-9])\b
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.((?1))\.((?1))\.((?1))/(3[0-2]|[1-2]?[0-9])\b
@gangadhars

This comment has been minimized.

Copy link

commented Nov 17, 2017

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.