[% SET a = 'aaa12aaa34aaa56' -%]
[% a.replace('\\\d\\\d', 'bb', 'g') %]
[% a.replace('\\\d\\\d', '', 'g') %]