$re = '/^(?=.*s|Alla dagar)(?=(?<from>\d+) ?- ?(?<to>\d+)).*$/m';
$str = '### Sign 1 - Should match
8-17
Alla dagar
### Sign 2 - Should match
Alla dagar
08-21
### Sign 3 - Should not match
8-17
### Sign 4 - Should mathc
7 - 9 Alla dagar
### Sign 5 - Should match
Alla dagar 17-23';
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