I have a regex /id=?\d*-\d*/
i tested it here live demo
but when i use this code for getting id=3607-7
$line = '[24/Oct/2016:11:20:57 +0200] "GET /ajax/magasins/initMagasin.php?id=3607-7 HTTP/1.1" 200 747 "https://asdjjhdsa.fr/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50';
preg_match('id=?\d*-\d*', $line, $matches);
echo $matches[1] ."\n";
i have this warning
PHP Warning: preg_match(): Delimiter must not be alphanumeric or backslash
I read this question and when i use
preg_match('/id=?\d*-\d*/', $line, $matches);
i have this notice
PHP Notice: Undefined offset: