php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10516 Recursive patterns don't work
Submitted: 2001-04-26 17:05 UTC Modified: 2001-04-26 17:14 UTC
From: martijn at ideeweb dot nl Assigned:
Status: Closed Package: PCRE related
PHP Version: 4.0.4pl1 OS: Win2K & Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: martijn at ideeweb dot nl
New email:
PHP Version: OS:

 

 [2001-04-26 17:05 UTC] martijn at ideeweb dot nl
$s = "a(b(c)d)e(f)g";
$p = "/\( ( ( (?>[^()]+) | (?R) )* ) \)/xU";
if (preg_match_all($p, $s, $x)) {
   echo "match";
   // see what's in $x
} else {
   echo "no match";
}


This example pattern is taken straigh out of the PCRE docs, but I don't get the desired result, whatever I try. I haven't been able to succesfully use the experimental (?R) so I was wondering if anyone ever has.

In perl, recursive patterns seem to work fine by the way.


Regards,
Martijn

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-26 17:14 UTC] andrei@php.net
The results you get are consistent with (?R) description in PCRE docs. If you have a problem with that, contact the PCRE library author, please.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC