php.net |  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
 [2010-01-11 16:33 UTC] andrew at coolboxcreative dot com
Description:
------------
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:
---------------
http://www.coolboxcreative.com/demo/php_bug/source.txt

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 
....

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-11 16:39 UTC] scottmac@php.net
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 
that
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 05:01:29 2024 UTC