in reply to only want numerics in field
You could use Regexp::Common's "number" extension to detect reals, which is what you seem to be seeking:
if( $string =~ /^$RE{num}{real}$/ ) { print "Match!\n"; } else { print "Reject!\n"; }
You don't want to invent this yourself. Just look at the regular expression that $RE{num}{real} contains:
perl -MRegexp::Common=number -E 'say $RE{num}{real}' (?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[ +0123456789]{0,}))?)(?:(?:[E])(?:(?:[-+]?)(?:[0123456789]+))|))
...better off using a solution from Regexp::Common, or the looks_like_number() utility Limbic~Region suggested, or both.
Dave
|
|---|