I have written a micro framework as an experiment using string
replacement with regular expressions. The construct looks somewhat
like this:

someTemplateString.replace(/fancyregexp/g, function(match,
group1, ...) { return replacement; });

However, I don't have the code at hand. If you are interested I can
post it on Tuesday evening CET.

- Max


On 23 Apr., 17:39, Rambo <[email protected]> wrote:
> Is there any way to implement recursive patterns in regular expressions? [1]
> I want to build a template engine which supports if/else/foreach statements
> that can be nested. I've done that in PHP using regular expressions, but I
> cannot figure out how to do this in JS without support for recursive
> patterns. Any ideas?
>
> [1]http://www.php.net/manual/en/regexp.reference.recursive.php

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to