From: Kevin Ballard Date: 2005-10-19T03:16:57+09:00 Subject: Re: Regexp problem for template language If you want between {{ }} variables, shouldn't that second branch of the regexp be {2,} rather than +? Not to mention that it never matches the closing }}. It might be better to, instead of trying to do it all with just a regex, implement a stateful parser that matches an opening tag and matches a closing tag from there. That way you can also add spiffy stuff like nested tags.