Bug #76975 [Opn->Dup]: preg_match difference between 7.3 and < 7.3 - II

From: Date: Fri, 05 Oct 2018 17:49:00 +0000
Subject: Bug #76975 [Opn->Dup]: preg_match difference between 7.3 and < 7.3 - II
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217440@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: requinix@php.net Reported by: mlocati at gmail dot com Summary: preg_match difference between 7.3 and < 7.3 - II -Status: Open +Status: Duplicate Type: Bug Package: PCRE related Operating System: Any PHP Version: 7.3.0RC2 Block user comment: N Private report: N New Comment: See bug #76188 Previous Comments: ------------------------------------------------------------------------ [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.bugs (#217440) next »