Bug #53605 [Opn->Csd]: Regexp can not be compiled

From: Date: Fri, 24 Dec 2010 12:39:25 +0000
Subject: Bug #53605 [Opn->Csd]: Regexp can not be compiled
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157302@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53605&edit=1 ID: 53605 User updated by: fogia_4 at hotmail dot com Reported by: fogia_4 at hotmail dot com Summary: Regexp can not be compiled -Status: Open +Status: Closed Type: Bug Package: Regexps related Operating System: MacOSX 10.6.5 PHP Version: 5.3.4 Block user comment: N Private report: N New Comment: I'm closing this report as I figured out what this is really about. Previous Comments: ------------------------------------------------------------------------ [2010-12-24 13:37:48] fogia_4 at hotmail dot com After investigating further, it turned out to be a bug in the PCRE library. Compiling the pcre extension from pcre 8.10 fixed the compilation. ------------------------------------------------------------------------ [2010-12-24 13:21:48] fogia_4 at hotmail dot com Description: ------------ Although one of my regular expressions was compiled smoothly with php-5.3.3, I get the following exception message with php-5.3.4: Exception: preg_match(): Compilation failed: unknown option bit(s) set at offset 0 Test script: --------------- $symbol = "\xE2\x89\xA1"; $operands = 'a:3:{i:0;s:115:"/left\.operand'.$symbol.'(.?)(operand\.([^'.$symbol.']*)'.$symbol.'?([^'.$symbol.']*)?)?|right\.operand'.$symbol.'(.?)(operand\.([^'.$symbol.']*)'.$symbol.'?([^'.$symbol.']*)?)?/u";i:1;s:18:"left.operand'.$symbol.'⇒";i:2;N;}'; $op = unserialize( $operands ); $operand_pattern = $op[0]; $operand_index = $op[1]; $operand_matches = $op[2]; echo $operand_pattern, '<br />'.'<br / >'; echo $operand_index; $operand_match = preg_match( $operand_pattern, $operand_index, $operand_matches ); Expected result: ---------------- The string stored in the variable called 'operand_pattern' should be compiled as a valid regular expression. Actual result: -------------- An exception is thrown. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53605&edit=1

« previous php.bugs (#157302) next »