How using PHP regex could a match be excluded if the pattern is inside another pattern.
The string/template being using looks like this:
{employee.name}
{history}
{employee.name}
{/history}
The PHP regex pattern being used is this:
{employee([A-Za-z0-9\.]+)}
The problem with this pattern is that it will match {employee.name} twice. It needs to exclude the match if it's inside {history}*{/history}.