[PHP] Re: Help with a regular expression for 0,1 or 2 decimal places

2005-10-25 Thread Phillip Oertel
hi, i'm not a regex guru myself, but the following regex should work - tabke a look at my regex test setup ... ?php $test = array( 1, 1., 1.2, 1.23, 1.234, 1234, 1234., 1234.5, 1234.56, 1234.567 ); // if there's a dot, we want at least one number after

Re: [PHP] Re: Help with a regular expression for 0,1 or 2 decimal places

2005-10-25 Thread Florent Monnier
Phillip Oertel a écrit : hi, i'm not a regex guru myself, but the following regex should work - tabke a look at my regex test setup ... ?php $test = array( 1, 1., 1.2, 1.23, 1.234, 1234, 1234., 1234.5, 1234.56, 1234.567 ); // if

Re: [PHP] Re: Help with a regular expression for 0,1 or 2 decimal places

2005-10-25 Thread John Nichel
Phillip Oertel wrote: hi, i'm not a regex guru myself, but the following regex should work - tabke a look at my regex test setup ... ?php $test = array( 1, 1., 1.2, 1.23, 1.234, 1234, 1234., 1234.5, 1234.56, 1234.567 ); // if there's a dot, we want

[PHP] Re: Help with a regular expression for 0,1 or 2 decimal places

2005-10-24 Thread Al
Shaun wrote: Hi, I am trying to create a regular expression for a width of a room, the value can be a whole integer (up to 999) with up to 2 decimal places -when it is stored in the database mysql will pad the value accordingly. /^[0-9]{1,3}.?[0-9]{0,2}?$/ The only problem I have found