You are here: Re: Regular Expressions « All PHP « IT news, forums, messages
Re: Regular Expressions

Posted by robert on 05/04/06 02:42

| The 'correct' format is either
| 1. 8-15@113.5
| ie a number (an integer between 1 and 500 say), followed by one '-'
| followed by a number (an integer between 1 and 500 say), an @ and a
| number to end (a float between 1 and 10000 say), or
|
| 2. 43@226 ie without the first '8-'
|
| Any guidance as I'm tearing my hair out.!?

/^(\d+-)?\d+@\d+.?\d+$/

this assumes that a dot (.) is your decimal seperator - if currency, some
countries use a comma (,).

anyway, hth.

me

(i've no hair left to pull out...but i know my regex's ;^)

 

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

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