|
Posted by AlexVN on 01/30/07 23:31
On Jan 30, 11:19 pm, "gene.el...@gmail.com" <gene.el...@gmail.com>
wrote:
> Hey everyone! I am banging my head on this regular expression problem.
> I want to validate US currency. So far I have '^(\.[0-9]+|[0-9]+(\.
> [0-9]*)?)$'
>
> but this fails if I use a commna (i.e. 2,000.00). Any help would be
> greatly appreciated!
Use '^(\.[0-9]+|[0-9,]+(\.[0-9]*)?)$' - this will also accept
2,0,0,0.00
Or use ^(([0-9]{1,3},)*[0-9]{1,3}|[0-9]+)(\.[0-9]+)?$'
Navigation:
[Reply to this message]
|