Re: Regular Expression question..simple!
- From: "AlexVN" <alexander.netkachev@xxxxxxxxx>
- Date: 30 Jan 2007 15:31:10 -0800
On Jan 30, 11:19 pm, "gene.el...@xxxxxxxxx" <gene.el...@xxxxxxxxx>
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]+)?$'
.
- Prev by Date: Re: php.ini for every vhost
- Next by Date: Re: php.ini for every vhost
- Previous by thread: php.ini for every vhost
- Next by thread: POST checkbox group
- Index(es):