Can anybody help me to understand what those lines are doing ?
VAR_TOKEN_START = '{{'
VAR_TOKEN_END = '}}'
BLOCK_TOKEN_START = '{%'
BLOCK_TOKEN_END = '%}'
TOK_REGEX = re.compile(r"(%s.*?%s|%s.*?%s)" % (
VAR_TOKEN_START,
VAR_TOKEN_END,
BLOCK_TOKEN_START,
BLOCK_TOKEN_END
))
TOK_REGEX.split('{% each vars %}<i>{{it}}</i>{% endeach %}')
I don't understand the % on the regex expression. And why we split on TOK_REGEX variable expression.