$re = '/{[^}]*name:[^}]*\bthe\b[^}]*}/i';
$str = '{
id: 1
locID: A
tStart: 17:10:00
tEnd: 17:35:00
name: the man 45
text: Lorum Ipsum
}
{
id: 2
locID: A
tStart: 17:11:00
tEnd: 17:12:00
name: Frank
text: Lorum Ipsum
}
{
id: 3
locID: A
tStart: 17:11:00
tEnd: 17:14:00
name: there Frank
text: Lorum Ipsum
}
{
id: 4
locID: B
tStart: 17:51:00
tEnd: 17:56:00
name: the woman 2
text: Lorum Ipsum
}
{
id: 5
locID: A
tStart: 17:11:00
tEnd: 16:11:00
name: the man with the golden gun
text: Lorum Ipsum
}
{
id: 6
locID: C
tStart: 17:11:00
tEnd: 17:11:00
name: the woman with the dragon tattoo
text: Lorum Ipsum
}
{
id: 7
locID: A
tStart: 17:15:00
tEnd: 17:15:00
name: Jo
text: Lorum Ipsum
}';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php