regex for ordinal numbers - working with it two days and I hate r egex...

From: Date: Thu, 24 Aug 2000 18:45:16 +0000
Subject: regex for ordinal numbers - working with it two days and I hate r egex...
Groups: php.windows 
Request: Send a blank email to php-windows+get-2118@lists.php.net to get a copy of this message
While I wait for Mastering Regular Expressions (O'Reilly) to get here, could someone give me a hand with this regex? if (eregi( "([0-9]{1,2})+([a-z]{1,2})" , $piece[1] ) { echo "running the ordinal changer"; } It's **supposed** to look for 1 or 2 numbers followed by 1 or 2 uppercase letters such as 1ST or 2ND or 15TH or 23D I'm not really sure that what is above is even close... all I know is that it's not picking it up in its present form... Thanks in advance, John If anyone is interested, it will be follow with a changer which will change the ordinal number into a full word i.e., 1ST becomes FIRST --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer - http://www.lcounty.com Licking County, Ohio, USA 740-349-3631 > -----Original Message----- > From: Zak Greant [mailto:zak@php.net] > Sent: Thursday, August 24, 2000 2:09 PM > To: James Duncan > Cc: Pablo Vera; php-windows@lists.php.net > Subject: RE: Re[2]: [PHP-WIN] Preventing multiple submits > > > At 06:56 PM 8/24/00 +0100, James Duncan wrote: > >Zak, > > > >Are you saying by default that as soon as PHP receives a > form it doesn't > >accept any more forms from the same client? > > No. I am saying that your script should work this way. > > ie. > if (! $post_counter) > // handle form submission > else > print "Your form has been sent"; > > if ($HTTP_POST_VARS[$submit]) > $post_counter = 1; > > > > This doesn't seem to be the case > >on the PHP script I've written. I've developed a "Tell A > Friend" form > >where the user enters a friends name and email address and > then clicks on > >submit. > >The form is posted to a PHP script that performs data > validation and then > >generates an email. However, if the user clicks on the submit button > >several times then 2 emails are sent, etc. > > > >Thanks > > > >James > > > > > >-----Original Message----- > >From: Zak Greant [mailto:zak@php.net] > >Sent: 24 August 2000 18:14 > >To: Pablo Vera > >Cc: James Duncan; php-windows@lists.php.net > >Subject: Re[2]: [PHP-WIN] Preventing multiple submits > > > >At 12:03 PM 8/24/00 -0500, Pablo Vera wrote: > > >[snip] > > >James, Zak: > > > > > >I'm not so sure this is a good idea, I think that the > problem should > > >be resolved, where the problem is originated, and > eventhough I prefer > > >PHP, I think that in this case it should be solved by the > Client-Side, > > >i.e. JavaScript. > > > >JavaScript is not a reliable choice for this matter. It is > not available > >on some clients. On the clients that support it, it can be disabled. > > > > >What I don't like of the Server-Side solution is > > >that the form WILL BE submitted a second time, and that > (I'm not so sure) > > >the first submission will somehow be interrupted by the second one. > > > >As soon as the PHP script receives one form, then it will > not accept any > >further forms from the same client. So, either a form is > received and no > >more will be accepted from the same client in the same > session or a form > >has not been received... > > > >- zak > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#2118) next »