RegEx recursive in-between
| From: | Mirko Buffoni | Date: | Sat, 22 May 2004 19:03:42 +0000 |
| Subject: | RegEx recursive in-between | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11393@lists.php.net to get a copy of this message | ||
Hi folks,
sorry for the bit off-topic question.
I'm trying to build a modified which use regular expressions
to catch text in between a start and stop tags.
Something to get the text between <td ...> and </td>
regardless recursion that may happen in between.
I tried to apply the example of recursion which is
used with parentesis balancing
\( ( ( (?>[^()]+) | (?R) )* ) \)
so is possible to have something like
!<td[^>]*> ( ( ( ?> !<td ) | (?R) )* ) </td>!ixs
^^^^This gives error. I want to say 'everything which is not <td' is valid not to enter recursion. Thanks for help, and forgive my bad english Mirko