The problem is that \A only applies to the first alternation and \Z only to the last. You want parentheses to make the anchors relevant to all alternations:
my $valid_host = qr/\A (?: (?: $RE{net}{IPv6} ) | (?: $RE{net}{IPv4} ) | (?: $RE{net}{domain}{-nospace}{-rfc1101}\.? ) ) \Z/x;
In reply to Re: regexp::common::net unexpected failure
by Corion
in thread regexp::common::net unexpected failure
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |