in reply to Accepting a template string and replacing placeholders the way printf does.

Although Template Toolkit is usually used for HTML templates, it sounds like a perfect fit for your application. TT uses [% tag %] syntax and it really does not care what is around it. It has some simple logic and looping constructs, and is very easy to learn and implement.

grep
grep> cd pub grep> more beer