AlwaysLearning has asked for the wisdom of the Perl Monks concerning the following question:
for the typical 0-255 range. None of the answers I've found have attempted to address the question by using the code execution feature of regex. The problem I can't solve is how to report the result of the match!(2[0-4]\d|25[0-5]|[01]?\d?\d)
perl -n -e "print (( $x = $_ =~ m@^(\d+)(?{if ($^N < 255 && $^N > 233) + {print 'true '}})$@ ) . ' ' )"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: does code help regex match numeric ranges?
by grinder (Bishop) on Nov 04, 2007 at 10:02 UTC | |
by moritz (Cardinal) on Nov 04, 2007 at 10:28 UTC | |
by mwah (Hermit) on Nov 04, 2007 at 13:10 UTC | |
by Krambambuli (Curate) on Nov 04, 2007 at 12:21 UTC | |
|
Re: does code help regex match numeric ranges?
by moritz (Cardinal) on Nov 04, 2007 at 07:55 UTC | |
|
Re: does code help regex match numeric ranges?
by mwah (Hermit) on Nov 04, 2007 at 11:37 UTC | |
by AlwaysLearning (Sexton) on Nov 06, 2007 at 20:44 UTC | |
|
Re: does code help regex match numeric ranges?
by rminner (Chaplain) on Nov 04, 2007 at 11:08 UTC |