Test, validate and match regular expressions
This PCRE regex matches valid IPv4 addresses, ensuring each octet is a number between 0 and 255. It also optionally matches a port number appended after a colon, limited to 1-4 digits. This is highly useful for validating network configurations, server addresses, or log parsing where IP and port combinations are common.