shadowfox has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to check the value and make sure its a whole number between 1 and 75, so 1,2,3,4 but not 20.5 or 97 or -5, etc. In my head it makes sense, I've done both separately before, whats missing to make it work in this context? Better way to do it? I messed with it a bit with no luck so I come seeking wisdom :)
if ($_ =~ /\something(.*)somethingelse/i){ if($1 => 1 and $1 <= 75 and /\d{1}-\d{2}/) { ... } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Matching numeric value between two digits
by toolic (Bishop) on Feb 04, 2013 at 21:37 UTC | |
by shadowfox (Beadle) on Feb 04, 2013 at 22:44 UTC | |
by Crackers2 (Parson) on Feb 04, 2013 at 23:27 UTC | |
Re: Matching numeric value between two digits
by SuicideJunkie (Vicar) on Feb 04, 2013 at 21:48 UTC | |
by shadowfox (Beadle) on Feb 04, 2013 at 22:46 UTC | |
Re: Matching numeric value between two digits
by ww (Archbishop) on Feb 05, 2013 at 01:41 UTC | |
Re: Matching numeric value between two digits
by 7stud (Deacon) on Feb 05, 2013 at 00:43 UTC | |
Re: Matching numeric value between two digits
by BillKSmith (Monsignor) on Feb 05, 2013 at 04:09 UTC | |
Re: Matching numeric value between two digits
by 7stud (Deacon) on Feb 05, 2013 at 02:11 UTC |
Back to
Seekers of Perl Wisdom