TODO: automated script
# Strings
\{\{\s(.*)\s\}\}
<?=\$$1; ?>
# Arrays
# with space
\{\{\s(.*?)\.(.*?)\s\}\}
<?=\$$1['$2']; ?>
#without space
\{\{(.*?)\.(.*?)\}}
<?=\$$1['$2']; ?>
# {% if $a['b'] %}
([\{%])+\s+if\s+.*?(.*?)?\.(.*?)\s+%}
<?php if \(\$$2['$3']\) { ?>
# THEN try this Try this at first:
### ([\{%])+\s+.*?(.*?)?\.(.*?)\s
### \$$2['$3']
# Careful, dots and spec symbosl in variables
\{\% if (\w*) \%\}
<?php if \(\$$1\) { ?>
# if in_array 2nd level
##\{% if (.*?)\.(.*?) in (.*?) %}
##<?php if(in_array(\$$1['$2'], \$$3)) { ?>
# 2nd level array
##\{% for (.*?) in (.*?)\.(.*?) %}
##<?php foreach(\$$2['$3'] as \$$1) { ?>
# 1st level
\{% for (.*?) in (.*?) %}
<?php foreach\(\$$2 as \$$1\) { ?>
# Elses
\{% else %}
<?php } else { ?>
# end of if and for
\{% (endfor|endif) %}
<?php } ?>
# Ifs
\{% if (.*) %}
<?php if\(\$$1\) { ?>
# IF Arrays again
\{%\sif\s(.*?)\.(.*?)\s==\s(.*)\s%\}
<?php if\(\$$1['$2'] == $3 \) { ?>
# Just an array
(\h)(\w+)\.(\w+)
\$$2['$3']