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.
In reply to Re: How to print a substring using regex
by bobf
in thread How to print a substring using regex
by mad2code
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |