Re: [PHP] Regular Expression

This is a discussion on Re: [PHP] Regular Expression within the PHP General forums, part of the PHP Programming Forums category; On Tue, Jul 08, 2003 at 06:47:26AM -0500, Wendell Brown wrote: > > I think this would do ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-08-2003
Paul Chvostek
 
Posts: n/a
Default Re: [PHP] Regular Expression

On Tue, Jul 08, 2003 at 06:47:26AM -0500, Wendell Brown wrote:
>
> I think this would do better...
>
> if( preg_match( "/P[\. ]*O\.* +BOX/i", $address ) )


Unless preg_match does something non-standard, you don't need to escape
a period that's inside square brackets. In fact, the regexp you've
built will also match an $address of "p\o box".

--
Paul Chvostek <paul@it.ca>
it.canada http://www.it.ca/
Free PHP web hosting! http://www.it.ca/web/

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:09 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0