Re: ereg and ] and -
| From: | Yurais Fernandez Leal | Date: | Thu, 06 Jul 2000 04:18:36 +0000 |
| Subject: | Re: ereg and ] and - | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5155@lists.php.net to get a copy of this message | ||
Did you try twho BackSlahes ??
ie
\\[
On Wed, 5 Jul 2000, Charles Killian wrote:
Charle: 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?
Charle:
Charle:
Charle: $var = "\$!@#$%^&*()+=/<>{}[-]";
Charle: if(!ereg("[^0-9\$\!\@\#\$\%\^\&\*\(\)\+\=\/\<\>\{\}\[\-\]]", $var)){
Charle: return TRUE;
Charle: }else{
Charle: return FALSE;
Charle: }//end else
Charle:
Charle: Charles
Charle:
--
----------------------------------
Yurais Fernández Leal
MediRed Network SysAdmin.
yurais@medired.scu.sld.cu
http://www.scu.sld.cu/
ICQ: 33792610 ICQ-GW: 1031
Phone: (53) 226-54204
------------