Bug in PHP4.0b3 perl-compatible regex?

From: Date: Wed, 08 Dec 1999 23:58:11 +0000
Subject: Bug in PHP4.0b3 perl-compatible regex?
Groups: php.version4 
Request: Send a blank email to php-version4+get-7686@lists.php.net to get a copy of this message
I'm trying to make a perl-compatible regular expression work properly under php 4.0b3, and am frustrated by a weird behavior. At first I thought it was a lack of understanding, but now I'm pretty convinced it's a farily serious bug. Here's my simple test file... ---- <?php print preg_replace('/<(\w+)>/','\\1', 'This <tests> removing <some> braces from a <string>'); ?> ---- And here's the result of three consecutive reloads of the page... This tests removing fro braces from a Üw,ûÀ? This tests removing fro braces from a Üøs¸ This tests removing fro braces from a k Note that I've tried lots of permuations of this, including double quotes with lots more escaping, etc, but the behavior is the same. I'd use standard regex but what I really want is to use pcre with the /e modifier to evaluate some expressions in some strings. Anybody have any ideas why this is happening? ANy ideas for workarounds? Is this a known bug in php4b3 or am I doing something wrong? I'm running php 4.0b3 under Apache 1.3.9, under apxs.

« previous php.version4 (#7686) next »