[% SET a = 'aaa12aaa34aaa' -%] [% a.split('\\\d\\\d').join(' ') %] [% SET a = '1aaa2aaa3aaa4' -%] [% a.split('aaa').join(' ') %]