$re = '/(ontologies\.version is.*|Application Displayable Version:.*)/';
$str = 'The value found for ontologies.version is : 0.1.1822.v20150903-1030
Application Displayable Version: CI-1.1.32-1652';
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