I have really strange issue with regex, I am testing using LINK Please only test there as it works exactly the same as on my machine. I should be able only to see following text: "Audit Note by 3 4 5 6 7" But I can see an empty array. I know that this code works on regex101.com Please help
$string = "1
2
Audit Note by 3
4
5
6
7
I don't need this line
I don't need this line
";
preg_match("/^Audit Note by(.*$)^$/ms",$string, $nmatch);
echo $nmatch[0];