ereg and ] and -

From: Date: Thu, 06 Jul 2000 03:26:58 +0000
Subject: ereg and ] and -
Groups: php.general 
Request: Send a blank email to php-general+get-5153@lists.php.net to get a copy of this message
I'm trying to use ereg to match on numbers and a load of special characters. I have it working on all of the special character except the ] and the -. Is there something special I need to do to get these two characters, ] -, to work? $var = "\$!@#$%^&*()+=/<>{}[-]"; if(!ereg("[^0-9\$\!\@\#\$\%\^\&\*\(\)\+\=\/\<\>\{\}\[\-\]]", $var)){ return TRUE; }else{ return FALSE; }//end else Charles

« previous php.general (#5153) next »