Doc #77316 [Ver->Csd]: (?X) produces warning: Compilation failed: unrecognized character after (? or (
| From: | cmb@php.net | Date: | Tue, 18 Dec 2018 19:22:33 +0000 |
| Subject: | Doc #77316 [Ver->Csd]: (?X) produces warning: Compilation failed: unrecognized character after (? or ( | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16221@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77316&edit=1
ID: 77316
Updated by: cmb@php.net
Reported by: sp at fp dot de
Summary: (?X) produces warning: Compilation failed:
unrecognized character after (? or (
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: PCRE related
PHP Version: 7.3.0
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-12-18 19:22:11] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=346384
Log: Fix #77316: (?X) produces warning: Compilation failed: unrecognized character after (? or (
------------------------------------------------------------------------
[2018-12-18 19:10:46] cmb@php.net
> "The current patch reverts the behavior to the meaning of 'X'
> how it was in PCRE"
This is about the X *modifier*, not about the internal option.
So yes, this is a documentation issue.
------------------------------------------------------------------------
[2018-12-18 18:35:07] sp at fp dot de
Description:
------------
Using the PCRE_EXTRA modifier as an internal option setting inside the pattern string now produces a
warning:
"Warning: preg_match(): Compilation failed: unrecognized character after (? or (?- at offset
2"
I'm not really sure if this is intentional, as the RFC states:
"The current patch reverts the behavior to the meaning of 'X' how it was in
PCRE"
https://wiki.php.net/rfc/pcre2-migration
If it indeed is intentional, then at least the documentation should be updated accordingly:
http://php.net/manual/en/regexp.reference.internal-options.php
Test script:
---------------
preg_match('/(?X)/', '');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77316&edit=1