RE: [PHP-DB] problem with regular expression

From: Date: Mon, 16 Jul 2001 13:41:15 +0000
Subject: RE: [PHP-DB] problem with regular expression
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10445@lists.php.net to get a copy of this message
Why not simply : "[a-zA-Z0-9]+" that would match any sequence of letters or numbers ? ----- Mensaje original ----- De: "Jennifer Arcino Demeterio" <eper@tridel.net> Para: <php-db@lists.php.net> Enviado: lundi 16 juillet 2001 04:35 Asunto: [PHP-DB] problem with regular expression i have a script to identify if the input is a combination of letters and numbers if (eregi("[a-zA-Z0-9][0-9]+[a-zA-Z][0-9a-zA-Z]",$fieldvalue)) print "alphanumeric" } else { not an alphanumeric } my problem is, when the string ends with a number, for example hello123, it says "not an alpanumeric" ... it works fine when the number is placed before the letters or in between letters ... why is that? i would really appreciate your help, thanks very much :)

« previous php.db (#10445) next »