php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53605 Regexp can not be compiled
Submitted: 2010-12-24 13:21 UTC Modified: 2010-12-24 13:39 UTC
From: fogia_4 at hotmail dot com Assigned:
Status: Closed Package: Regexps related
PHP Version: 5.3.4 OS: MacOSX 10.6.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fogia_4 at hotmail dot com
New email:
PHP Version: OS:

 

 [2010-12-24 13:21 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-24 13:37 UTC] fogia_4 at hotmail dot com
-: shal@semantic-fidelity.org +: fogia_4 at hotmail dot com
 [2010-12-24 13:37 UTC] 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:39 UTC] fogia_4 at hotmail dot com
-Status: Open +Status: Closed
 [2010-12-24 13:39 UTC] fogia_4 at hotmail dot com
I'm closing this report as I figured out what this is really about.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 20 18:01:22 2019 UTC