Reply to Re: Regular Expression question..simple!

Your name:

Reply:


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]+)?$'

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация