<?php

$string = "This is {test} for [a]{test2} for {test3}.";
$regex      = '/\[[^]]*]\{[^}]+}(*SKIP)(*F)|\{[^}]+}/';
echo preg_match_all($regex, $string, $matches) . "\n";
print_r($matches[0]);