RE: [PHP] Re: Weird preg problem
| From: | SP | Date: | Thu, 04 Jul 2002 08:49:13 +0000 |
| Subject: | RE: [PHP] Re: Weird preg problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105397@lists.php.net to get a copy of this message | ||
Ahhhh that's what that means. Thanks Tracker
-----Original Message-----
From: Tracker 1 [mailto:tracker1@theroughnecks.net]
Sent: July 4, 2002 3:00 AM
To: php-general@lists.php.net
Subject: [PHP] Re: Weird preg problem
the /i means case insensitive, remove the i, and it will work as intended.
--
=======================================================================
Michael J. Ryan - tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net
telnet://theroughnecks.net
=======================================================================
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/
"Sp" <internetracer@yifan.net> wrote in message
news:NDBBJHKAELJNNJMBMFHDGEIGDHAA.internetracer@yifan.net...
> Hi I am trying to check if a word contains only capital letters. For some
> reason it's not working. The below example is checking the word "weird"
to
> see if it's all capital letters but it's saying it's matches. I've tried
> checking for only lower case letters with "WEIRD" and it's not working
there
> too. What am I doing wrong?
>
>
> $pattern = "A-Z";
> $regexp = '/^['.$pattern.']*$/i';
> if( preg_match($regexp, "weird") )
> echo "matches";
> else
> echo "does not match";
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php