Posted by Paul Renton on 02/27/06 18:53
Hi,
I'm writing a templating system and everything's going great except for my
main stumbling block. Regular expressions. d:-(
What I'm trying to do is to pick out a starting tag and a finishing tag with
anything in-between but the finishing tag. For example:
{#my_tag}
blah blah blah
{/#my_tag}
However, if there is another instance of this also on the page like:
{#my_tag}
blah blah blah
{/#my_tag}
-- Stuff --
{#my_tag}
blah blah blah
{/#my_tag}
I don't want the regex to use the start of the first block and the end of
the second because that would cut out everything in between.
So what I'm looking for is something similar to:
{#tag_name}[anything that doesn't contain {/#tag_name}]{/#tag_name}
I hope this makes sense.
Many, many thanks in advance.
M@
[Back to original message]
|