Test, validate and match regular expressions
This regular expression validates IPv4 addresses on a line-by-line basis using the global and multiline flags. It ensures each of the four dot-separated octets falls within the valid numeric range of 0 to 255. Notably, it enforces strict formatting for the first octet by disallowing leading zeros, while permitting a standalone '0' in the subsequent octets. This pattern is ideal for extracting or verifying correctly formatted IP addresses within a larger block of text.