in reply to Roughly matching an ipv6 address with sql wildcard
If so, it's interesting that if I take (?: $RE{net}{IPv6} ) | out of the code, it behaves as expected -- that is, the value of $ip_query does not match $regex, when $regex is just (?: [0-9a-f:%]+)
Also interesting: when $regex is just (?: $RE{net}{IPv6} ) the string does not match, as expected -- that is, the test passes.
Looks like you need a set of parens that surrounds the conjunction alternation:
my $regex = qr/\A ( (?: $RE{net}{IPv6} ) | # A full IPv6 address (?: [0-9a-f:%]+ ) # A portion of an IPv6 address with SQL % wi +ldcards ) \Z/imsx;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Roughly matching an ipv6 address with sql wildcard
by neilwatson (Priest) on Sep 10, 2015 at 01:55 UTC | |
by graff (Chancellor) on Sep 10, 2015 at 02:03 UTC | |
by neilwatson (Priest) on Sep 10, 2015 at 12:16 UTC | |
by graff (Chancellor) on Sep 10, 2015 at 14:12 UTC | |
by Anonymous Monk on Sep 10, 2015 at 02:12 UTC |