Reply to Regular expression that's driving me mad

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация