in reply to regexp::common::net unexpected failure
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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: regexp::common::net unexpected failure
by neilwatson (Priest) on Nov 24, 2016 at 20:49 UTC |