RE: [PHP] Regular Expression
| From: | Giz | Date: | Tue, 08 Jul 2003 08:39:34 +0000 |
| Subject: | RE: [PHP] Regular Expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154321@lists.php.net to get a copy of this message | ||
I read your regex as
-match start of line
-followed by p, followed by o
=followed by single space
-followed by b,o,x
-followed by end of line
If someone puts in PO BOX 343, then your regex will not match.
If someone puts in PO BOX 12, then your regex will not match.
If you're saying that you think you are matching in strings that don't
contain "po box", I would be dubious of that claim.
-----Original Message-----
From: Ralph Guzman [mailto:ralph@nqionline.com]
Sent: Monday, July 07, 2003 9:59 PM
To: PHP General Mailing List
Subject: [PHP] Regular Expression
I have a form where I have to check whether user is submitting a PO Box
as an address. I wrote the following using eregi, but it returns true
even when the field is not Po Box. How do I go about doing this
properly?
if(eregi("^Po Box$", $address)){
$error_message_custom = "You cannot use a PO BOX for Bill To Address";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php