use Regexp::Common qw(net); ... my $dotted_decimal_ip = qr{ (?