in reply to Need a regex..
Something like this, maybe?
use strict; while (my $data = <DATA>) { chomp $data; if ($data =~ /^\d?\d?\d\.\d\d?\d?$/) { print "GOOD\n"; } else { print "BAD\n"; } } __DATA__ 12.12 123.123 0.1 1234.0 1234
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Need a regex..
by littlemonk (Sexton) on May 21, 2012 at 13:55 UTC | |
by kennethk (Abbot) on May 21, 2012 at 14:33 UTC | |
by Neighbour (Friar) on May 21, 2012 at 14:40 UTC |
In Section
Seekers of Perl Wisdom