Bug #10516: Recursive patterns don't work
| From: | martijn at ideeweb dot nl | Date: | Thu, 26 Apr 2001 21:05:56 +0000 |
| Subject: | Bug #10516: Recursive patterns don't work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52543@lists.php.net to get a copy of this message | ||
From: martijn@ideeweb.nl
Operating system: Win2K & Linux
PHP version: 4.0.4pl1
PHP Bug Type: PCRE related
Bug description: Recursive patterns don't work
$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
--
Edit Bug report at: http://bugs.php.net/?id=10516&edit=1