Test, validate and match regular expressions
This regex validates and matches IPv4 addresses. It ensures each of the four octets is a number between 0-255, properly handling leading zeros. The multiline and global flags make it suitable for finding multiple IP addresses in text documents or log files.