-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 03, 2005 6:03 PM
To: php-general@lists.php.net
Subject: [PHP] Re: eregi problem
i'm not familliar with regular expresions but i think that ^a-z - means
that variable must start witx a-z
Kim Madsen wrote:
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 03, 2005 6:03 PM
To: php-general@lists.php.net
Subject: [PHP] Re: eregi problem
i'm not familliar with regular expresions but i think that ^a-z - means
that variable must start witx
-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED]
Sent: Monday, April 04, 2005 3:08 PM
Putting the ^ _inside_ [] means NOT, so if any of the chars a-z0-9 is in
the string it´s NOT matched.
actually, that's not entirely correct. The regexp basically means that
if
Kim Madsen wrote:
-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED]
Sent: Monday, April 04, 2005 3:08 PM
Putting the ^ _inside_ [] means NOT, so if any of the chars a-z0-9 is in
the string it´s NOT matched.
actually, that's not entirely correct. The regexp basically means
i'm not familliar with regular expresions but i think that ^a-z - means
that variable must start witx a-z characters
you can chek it here:
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I m trying to check $GP[sifre]
I really dont know :)
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I m trying to check $GP[sifre] variable, $GP[sifre] must consist of alpha
numeric chars only. here, how I check the variable:
if((eregi([^a-zA-Z0-9],$GP[sifre])
echo 'true';
else
echo 'false';
It
you'd be better off with something like
if(preg_match('#^[a-z0-9]+$#i', $GP['sifre'])) {
echo 'contains only alphanumeric chars';
} else {
echo 'contains characters which are not alphanumeric';
}
- tul
[EMAIL PROTECTED] wrote:
I really dont know :)
[EMAIL PROTECTED] wrote in
7 matches
Mail list logo