in reply to How to print a substring using regex

To expand on ikegami's answer, take a look at Regexp::Common::net. It contains a pre-built regex pattern that recognizes dotted decimal IP addresses (constructing your own could be tricky). The example given in the synopsis section illustrates how it could be used. See also perlre for information about how to capture matches into variables.

  • Comment on Re: How to print a substring using regex