I am trying to test some user input in a program.
example.....
I am only want input of the form 700.00 not
700.00,,
I could write .....
if( $input != '700.00')
{
print "invalid";
}
But I never know what the user will input.
How do I overcome this problem using reg exp's?
Thanks
example.....
Code:
$input = '700.00,,'
if ($input !~ /\d+\.\d+/)
{
print "invalid";
}
I am only want input of the form 700.00 not
700.00,,
I could write .....
if( $input != '700.00')
{
print "invalid";
}
But I never know what the user will input.
How do I overcome this problem using reg exp's?
Thanks