#!/usr/bin/perl use strict; use warnings; use Test::More; use Regexp::Common qw/ net /; my $ip_query = "2 001:470:1d:a2f::%"; my $regex = qr/\A (?: $RE{net}{IPv6} ) | # A full IPv6 address (?: [0-9a-f:%]+ ) # A portion of an IPv6 address with SQL % wildcards \Z/imsx; unlike( $ip_query, $regex, "Test [$ip_query] against big regex" ); done_testing();