in reply to Regex for max length float
I'm not sure what you mean with "precision" (why isn't "12.3" valid?), but judging by your examples, and assuming your "number" really is a string, I come up with this:
$float =~ /\A(?:\d|\d?\.\d{1,3})\z/;
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex for max length float
by agianni (Hermit) on Mar 14, 2007 at 15:29 UTC | |
by johngg (Canon) on Mar 14, 2007 at 15:37 UTC | |
by agianni (Hermit) on Mar 14, 2007 at 16:27 UTC | |
by ikegami (Patriarch) on Mar 14, 2007 at 16:32 UTC | |
by Not_a_Number (Prior) on Mar 14, 2007 at 17:16 UTC | |
by agianni (Hermit) on Mar 14, 2007 at 19:58 UTC | |
by jeanluca (Deacon) on Mar 14, 2007 at 19:34 UTC |