Bug #81060 [Opn->Nab]: The expression does not compile correctly
| From: | imsop@php.net | Date: | Thu, 20 May 2021 17:14:02 +0000 |
| Subject: | Bug #81060 [Opn->Nab]: The expression does not compile correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233926@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81060&edit=1
ID: 81060
Updated by: imsop@php.net
Reported by: vklimin at 510710 dot com
Summary: The expression does not compile correctly
-Status: Open
+Status: Not a bug
Type: Bug
Package: PCRE related
Operating System: Debian 10
PHP Version: 8.0.6
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
The first character of the regex determines the delimiter; any extra instances of that delimiter
need to be escaped.
var_dump( preg_match( '/\Q\/\E/', '/' ) );
Previous Comments:
------------------------------------------------------------------------
[2021-05-20 17:09:51] vklimin at 510710 dot com
Changed the name of the corresponding package
------------------------------------------------------------------------
[2021-05-20 17:07:16] vklimin at 510710 dot com
Description:
------------
The expression does not compile correctly and generates a warning.
Test script:
---------------
var_dump( preg_match( '#\Q/\E#', '/' ) );
var_dump( preg_match( '/\Q/\E/', '/' ) );
Expected result:
----------------
int(1)
int(1)
Actual result:
--------------
int(1)
Warning: preg_match(): Unknown modifier '\' in [...][...] on line 1
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81060&edit=1