in reply to Regex Dollar Amounts
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.if ($amount =~ /^\d+\.\d\d$/) { # it's ok } else { # it's bad }
_____________________________________________________
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 |