in reply to I THOUGHT I'd finally understood regex
$local_ip_match starts by the character m, so it will try to match something that contains an m. That's probably not what you want.
The m in m/REGEX/ is an operator, so it should not be inside the string. You can try:
$s =~ m/^192\.168\.|^10\.|^127\.0\.|^172\.16\./
or if you want to store the regex in a variable:
$local_ip_match = qr/^192\.168\.|^10\.|^127\.0\.|^172\.16\./; see qr
Who's genex?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I THOUGHT I'd finally understood genex
by JEDtoo (Novice) on Jan 09, 2018 at 15:10 UTC | |
by Your Mother (Archbishop) on Jan 09, 2018 at 16:08 UTC | |
by JEDtoo (Novice) on Jan 09, 2018 at 16:14 UTC | |
by Laurent_R (Canon) on Jan 09, 2018 at 18:34 UTC | |
by karlgoethebier (Abbot) on Jan 14, 2018 at 19:35 UTC | |
|
Re^2: I THOUGHT I'd finally understood genex
by Laurent_R (Canon) on Jan 09, 2018 at 14:53 UTC | |
by Eily (Monsignor) on Jan 09, 2018 at 14:55 UTC |