[wp-trac] [WordPress Trac] #45644: Warning: preg_match(): Compilation failed in class-wp-block-parser.php line 382

WordPress Trac noreply at wordpress.org
Fri Dec 14 18:24:09 UTC 2018


#45644: Warning: preg_match(): Compilation failed in class-wp-block-parser.php line
382
--------------------------+------------------------------
 Reporter:  ledavdotnet   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  5.0.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by ayeshrajans):

 Hi there, welcome to Wordpress Trac!

 I'm not a WP core committer, so please take their advice over mine :). I
 tried to reproduce the error but I'm failing to do so.

 PHP 7.3 comes with PCRE version upgrade that might throw similar errors
 (https://ayesh.me/Upgrade-PHP-7.3#pcre2), but the regex compiles just fine
 across all versions from what I can see (https://3v4l.org/35aU0).

 From the patch, it looks like you changed the regex named subpattern
 syntax. I don't know if Wordpress has a code styling guideline for this,
 but in all PHP versions >=5.3, `/(?<name>pattern)/` should be identical to
 `/(?P<name>pattern)/` (https://regex101.com/r/xmdEiL/1/,
 https://regex101.com/r/VSaJUI/1).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45644#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list