Still an Almost working Regex

From: Date: Wed, 07 Mar 2001 00:09:43 +0000
Subject: Still an Almost working Regex
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-42831@lists.php.net to get a copy of this message
I have a working regex as below, used for validating data input: $Status = (ereg("^(^[A-Za-z0-9` !@#$%&()=:;\"\'.?/^|{}-]*)(.*)$", $String, $List)); It is definitely working as expected. I need to add the square brackets [ ] to the above list of allowed characters. However, this does not work. The regex does not produce an error message, but instead accepts all characters as valid. I have tried escaping them, ie: \[\] I have tried encoding them as HEX, ie: \x5b\x5d However, the same problem occurs in both circumstances. Can anyone please help me? ====================================================================== Murray Shields Email: murray@globalcat.com.au MU Systems Pty Ltd Phone: +61 7 3351 6677 Global Catalogs Pty Ltd Phone: +61 7 3351 4777

« previous php.general (#42831) next »