[% PROCESS template var=val var=val ... %] [% INCLUDE template var=val var=val ... %] #### my $re = qr{ \[%-? # start tag \s* (?:PROCESS|INCLUDE) \s+ (\S+) # template name .*? # any parameters you're not interested in -?%\] # end tag }xs;