c:\@Work\Perl\monks>perl -wMstrict -le "use Regexp::Common qw(net); ;; my $s = '123456.4.32.123456'; ;; print qq{A: match, captured '$1'} if $s =~ m{ ($RE{net}{IPv4}) }xms; ;; my $my_ip = qr{ \b $RE{net}{IPv4} \b }xms; print qq{B: match, captured '$1'} if $s =~ m{ ($my_ip) }xms; " A: match, captured '56.4.32.123'