$str=' this is my string{parent_id} hello';
if( preg_match("/{(.+?)}/isU",$str,$res)) echo $res[1];
#print_r($res);
结果输出parent_id
#另一种方法更好,有{} () [] <>都可以
$str = '中文abcd123${1,2,3,4,5}.jpg[123123]444<44g>44.124(j)12g4';
$search ='/[{(\[<](.*?)[})\]>]/';
if( preg_match($search,$str,$res)){
print_r($res);
}