You are here: Re: [PHP] REGEX Help Please « PHP « IT news, forums, messages
Re: [PHP] REGEX Help Please

Posted by John Nichel on 09/19/05 17:11

Shaun wrote:
> Hi,
>
> I am trying to implement a regular expression so that I have a number
> between 0.00 and 1.00. the following works except I can go up to 1.99
>
> $regexp = "/^[0-1]{1}.[0-9]{2}/";
>
> Can anyone help here please?
>
> Thanks
>

May have to go outside just a regex...

if ( preg_match ( "/^\d{1}\.\d{2}$/", $number ) && $number >= 0 &&
$number <= 1 )

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com

 

Navigation:

[Reply to this 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

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