I'm trying to get a string after a delimiter to the end of line with PHP and preg_match. These are my codes:
<?php
$stringa = <<<EOT
var1=Ciao
var2=Variabile
var3=We
EOT;
preg_match("#var2=(.*?)\n#", $stringa, $boh);
print_r($boh);
?>
This works, but not for the last line, if I replace var2 with var3 in the regex the generated array will be empty.