Doc #76975 [Ver->Csd]: preg_match difference between 7.3 and < 7.3 - II

From: Date: Sat, 06 Oct 2018 09:07:46 +0000
Subject: Doc #76975 [Ver->Csd]: preg_match difference between 7.3 and < 7.3 - II
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16051@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76975&edit=1 ID: 76975 Updated by: cmb@php.net Reported by: mlocati at gmail dot com Summary: preg_match difference between 7.3 and < 7.3 - II -Status: Verified +Status: Closed Type: Documentation Problem Package: PCRE related Operating System: Any PHP Version: 7.3.0RC2 Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=e345af1a2e9efbcd5919afeaadb2b8dbddcff4c1 Log: Fix #76975: preg_match difference between 7.3 and &lt; 7.3 - II Previous Comments: ------------------------------------------------------------------------ [2018-10-05 19:52:11] cmb@php.net Since this is the third time (at least) that this has been reported, we should explicitly mention it in UPGRADING. ------------------------------------------------------------------------ [2018-10-05 17:48:59] requinix@php.net See bug #76188 ------------------------------------------------------------------------ [2018-10-05 10:42:04] mlocati at gmail dot com Description: ------------ It seems that '/^[\\w-:]+$/' is no more a valid regular expression with PHP 7.3: we now have this error Compilation failed: invalid range in character class at offset 4 I understand that this regex is malformed (I think that the original author of the affected regex may have meant '/^[\\w\\-:]+$/'), but it's a breaking change: that regular expression worked for all the previous PHP versions (see https://3v4l.org/vD5O2 ) Test script: --------------- <?php $tag = 'p'; var_dump(preg_match('/^[\\w-:]+$/', $tag)); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76975&edit=1

« previous php.doc.bugs (#16051) next »