- preg_match: documentation ( source)
<?php
$regex= '#Schedule a (?<scheduletype>\w+)\swith\s(?<person>\w+)\sat\s(?<time>\w+)#';
preg_match($regex, 'Schedule a meeting with Ann at 3pm', $matches);
echo $matches['scheduletype']."\n";
echo $matches['person']."\n";
echo $matches['time']."\n";