Bug #862 Updated: problem in eregi()
| From: | Bug Database | Date: | Fri, 30 Oct 1998 03:04:05 +0000 |
| Subject: | Bug #862 Updated: problem in eregi() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2086@lists.php.net to get a copy of this message | ||
ID: 862
Updated by: rasmus
Reported By: markjr@easyDNS.com
Status: Closed
Bug Type: Misbehaving function
Assigned To:
Comments:
You have a number of problems in your regular expressions there. First, there is no such thing as
\- and even if there was you would have to write it as \\- because inside a double-quoted string in
PHP escape chars are parsed. In order to get the eregi() function to see \- you would have to
escape the \ and thus have \\-. That isn't you problem though. I quote from the Extended
Regular Expression docs (see regex/regex.7 in the PHP distribution):
To include a literal `]' in the list, make it the first
character (following a possible `^'). To include a lit-
eral `-', make it the first or last character, or the sec-
ond endpoint of a range. To use a literal `-' as the
first endpoint of a range, enclose it in
[.' and .]' to
make it a collating element (see below). With the excep-
tion of these and some combinations using `[' (see next
paragraphs), all other special characters, including `\',
lose their special significance within a bracket expres-
sion.
So, this tells you that you cannot put a '-' in the middle of a range like that. I do not
think this is a bug in PHP. PHP's behaviour is entirely consistent with that definition.
Full Bug description available at: http://ca.php.net/bugs.php3?id=862
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net