PHP GENERAL 34 RE PHP REGULAR EXPRESSION
Date: Tue, 8 Jul 2003 14:39:04 -0400

Subject: Re: [PHP] Regular Expression
From: paul+php@no-spam (Paul Chvostek)

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@no-spam>
it.canada http://www.it.ca/
Free PHP web hosting! http://www.it.ca/web/