|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76975 preg_match difference between 7.3 and < 7.3 - II
Submitted: 2018-10-05 10:42 UTC Modified: 2018-10-05 19:52 UTC
From: mlocati at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PCRE related
PHP Version: 7.3.0RC2 OS: Any
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.
Block user comment
Status: Assign to:
Bug Type:
From: mlocati at gmail dot com
New email:
PHP Version: OS:


 [2018-10-05 10:42 UTC] mlocati at gmail dot com
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 )

Test script:

$tag = 'p';

var_dump(preg_match('/^[\\w-:]+$/', $tag));


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-05 17:48 UTC]
-Status: Open +Status: Duplicate
 [2018-10-05 17:48 UTC]
See bug #76188
 [2018-10-05 19:52 UTC]
-Status: Duplicate +Status: Verified -Type: Bug +Type: Documentation Problem -Assigned To: +Assigned To: cmb
 [2018-10-05 19:52 UTC]
Since this is the third time (at least) that this has been
reported, we should explicitly mention it in UPGRADING.
 [2018-10-06 09:07 UTC]
Automatic comment on behalf of
Log: Fix #76975: preg_match difference between 7.3 and &lt; 7.3 - II
 [2018-10-06 09:07 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 11:03:35 2021 UTC