#!/usr/bin/perl my @numbers = (0, 3.14, 5 , 4_000_000, 3_000.42, "any strings 234 "); print "@numbers\n"; my @numgoods = grep{/^(\d*[\._]?\d+)$/ } @numbers; print "@numgoods\n";
In reply to Re^4: Valid Numbers or decimals
by zentara
in thread Valid Numbers or decimals
by perl_devel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |