<?php

$re = '~{((?:[^{}]++|(?R))*)}~'; 
$str = "abc {get me {!but not me!}} def {and get {!but not me again!} me} ghi"; 
preg_match_all($re, $str, $matches);
print_r($matches[1]);