I'm normally OK with regex, especially if I fiddle with it long enough, however I have fiddled with this one so long that I'm either totally missing it or it's something simple. Does it have anything to do with the backref, or the fact that the value of the backref has a $? I have:
$out = ' {$sites} <tr> <td> {Site.id} </td> </tr> {/$sites}'; And I want to capture the first {$tag}, everything in between and the last {$/tag}. I have tried several things and here is my current regex that looks like it should work, but doesn't: preg_match_all('|{\$([^}]+)}(.+)({/\1})|Us', $out, $matches); Gives: Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) [3] => Array ( ) ) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php