In article <002d01c0a69a$ea2c9aa0$[EMAIL PROTECTED]>,
[EMAIL PROTECTED] ("Murray Shields") wrote:
> $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.
According to the manual <http://php.net/manual/en/ref.regex.php>,
"These functions all take a regular expression string as their first
argument. PHP uses the POSIX extended regular expressions as defined by
POSIX 1003.2. For a full description of POSIX regular expressions see the
regex man pages included in the regex directory in the PHP distribution.
It's in manpage format, so you'll want to do something along the lines of
man /usr/local/src/regex/regex.7 in order to read it. "
If you do not have access to manpages at the commandline, note that they
are also widely republished on the web. A quick search on
<http://www.google.com/search?q=posix+1003%2E2+regular+expressions> reveals:
"A bracket expression is a list of characters enclosed in `[ ]'. It
normally matches any single character from the list (but see below). If the
list begins with `^', it matches any single character (but see below) not
from the rest of the list."
<snip>
"To include a literal `]' in the list, make it the first character
(following a possible `^')."
--
CC
--
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]