($x = $string) =~ s/        \[% \s* loop \s* \$ (\S+?) \s* %\] # [% loop $name %]        (\.*?)                             # Alles mögliche, will ich haben        \[% \s* end \s* %\]                # [% end %]    /        $2 if $1 eq $name    /xms;