From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 Description of problem: Trying to match a literal { or } inside a POSIX regex (ereg function for ex) doesn't work in all cases. Version-Release number of selected component (if applicable): php-4.1.2-7.3.6 How reproducible: Always Steps to Reproduce: <?php if (ereg("^\{$","{")) echo "^\{$ matched {"; if (ereg("^\{\}$","{}")) echo "^\{\}$ matched {}"; ?> Actual Results: Warning: Unmatched \{ in /usr/local/typo3/museum/phptest.php on line 2 Warning: Invalid content of \{\} in /usr/local/typo3/museum/phptest.php on line 3 Expected Results: ^{$ matched { ^{\}$ matched {} Additional info: Works OK in php 4.2.3. Not sure exact version when was fixed.
See http://www.php.net/manual/en/language.types.string.php You need to escape the regex pattern like ereg("^\{\}\$","{}"))
Slight problem here, the expression as I originally quoted it works OK on other compiles of php 4.1.2, including those in use by the php.net people. See http://bugs.php.net/bug.php?id=24821 As explained (and verified by me on several boxes), this very script works OK on other 4.1.2 compiles, on 4.2.2, on 4.2.3 and on latest PHP5-dev. I hear from some more experienced programmer that it's something to do with the non-default compiled regex library - maybe something to do with your "--with-regex=system" compile switch? The bottom line of this is that some perfectly working php code (as far as the rest of the world is concerned), doesn't work on RH 7.3. What can you do about it? Thanks Yan
Thanks for the report. This is a mass bug update; since this release of Red Hat Linux is no longer supported, please either: a) try and reproduce the bug with a supported version of Red Hat Enterprise Linux or Fedora Core, and re-open this bug as appropriate after changing the Product field, or, b) if relevant, try and reproduce this bug using the current version of the upstream package, and report the bug upstream. c) report the bug to the Fedora Legacy project who may wish to continue maintenance of this package.