|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50720 Named subpatterns are not working with the syntax ?<name> or ?'name', only wor
Submitted: 2010-01-11 16:33 UTC Modified: 2010-01-11 19:05 UTC
From: andrew at coolboxcreative dot com Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.2.12 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
9 - 5 = ?
Subscribe to this entry?

 [2010-01-11 16:33 UTC] andrew at coolboxcreative dot com
Named subpatterns are not working with the syntax ?<name> or ?'name', 
only working with ?P<name>

The newer syntax's work with version 5.2.9-2 (on windows) and 5.2.11 
(linux), but not version 5.2.12 (red hat)

Reproduce code:

Expected result:
id =
classes = test_class

id = div_two
classes = another_class

Actual result:
nothing outputted

nb. in the application I am using this in I get the following error:

Compilation failed: unrecognized character after (?< at offset 7' in 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-11 16:39 UTC]
Check your phpinfo for the version of the PCRE library, I'm guessing that the Redhat version is using an old copy from the system and not the bundled PHP version.
 [2010-01-11 17:58 UTC] andrew at coolboxcreative dot com
The PCRE library is indeed an older version, so presume bug is down to 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 13:01:27 2024 UTC