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: [EMAIL PROTECTED]
MU Systems Pty Ltd                              Phone: +61 7 3351 6677
Global Catalogs Pty Ltd                         Phone: +61 7 3351 4777


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to