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!
In reply to Re: Regex for max length float
by Sidhekin
in thread Regex for max length float
by agianni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |