How do I validate a mustache template string in PHP? For example, if I pass
Hi {{#name}}{{name}}{{/name}}{{^name}}guest{{/name}}
and the validator should return valid, but if I pass
Hi {{#name}}{{name}}{{/name}}{{^name}}guest
it should return invalid.
Note I'd rather this to be done fully in PHP with no Mustache_Engine
or any other 3rd party dependency.