Build, test, and debug regular expressions
This PCRE regex matches an IPv4 address, optionally followed by a CIDR routing prefix ranging from /0 to /32. It uses a subroutine call (?1) to efficiently reuse the octet matching logic (0-255) for each part of the IP address. This pattern is particularly useful for validating IP address inputs or VPC subnet CIDR blocks in configurations like AWS CloudFormation templates.