in reply to Regex Dollar Amounts

You want a regex like so:
if ($amount =~ /^\d+\.\d\d$/) { # it's ok } else { # it's bad }
It's really quite simple: the beginning of the string, one or more digits, a '.', two digits, and then the end of the string. I can't tell from your post whether or not you want to accept a leading - sign.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: Regex Dollar Amounts
by Additude (Initiate) on Oct 19, 2001 at 16:04 UTC
    Thanks!
    That worked great! I just had to change the =~ to !=, my code didn't like
    Having the print <<EOF; before thedisplay_output($templatefile,);
    Thanks for your help, I appreciate it!
    Wes