Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Re: Regex Dollar Amounts

by Additude (Initiate)
on Oct 19, 2001 at 15:51 UTC ( [id://119946]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Regex Dollar Amounts
in thread Regex Dollar Amounts

Hi Again Eric
I tried the line
if($amount =~ m/^-?(\d+)\.(\d\d)$/)
But this regex is forcing me to put a non digit character in place for it to be true
If I use $50.00, c50.00, abcd50.00 and so on it will produce a true result and allow the user to pass.
So here is what I did and it seems to be working
if ($Amount !~ m/^-?(\d+)\.(\d\d)$/) { display_output($templatefile,);#error page print <<EOF;#good result, move on

I had to change the =~ to !~ because it didn't like having
 print <<EOF; before the display_output($templatefile,);
for some reason.
But it looks like all is well in Dodge City now. Thanks!
Wes

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://119946]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-24 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found