Help for this page

Select Code to Download


  1. or download this
    my ($num) = $_num =~ /^(0*\.\d+)$/
    
  2. or download this
    my $num = ($_num =~ /^(0+(?:\.\d+)?|\.\d+)$/) ? 0+$1 : undef;
    
  3. or download this
    my ($num) = $_num =~ /^(...)$/
    undef $num if defined $num && ($num < 0 || $num >= 1);