You could use [man]preg_match/man:
<?php
$text = "
blah blah blah
nameofperson: Peter
yadda yadda yadda
dateofbirth: 06 12 86
end of message
";
$name = (preg_match('/nameofperson:\s*(\w+)/', $text, $matches)) ?
$matches[1] : '';
$dob = (preg_match('/dateofbirth:\s*(\d+\s\d+\s\d+)/', $text, $matches)) ?
$matches[1] : '';
printf("<p>Name: %s, Date of Birth: %s</p>\n", $name, $dob);
?>