Replace " ." in your regex with " [^%]":
preg_match_all("/%[^%]*%/", "%hey%_thereyou're_a%rockstar%\nyo%there%", $matches);
, , "." "" , , , % . "[^%]" , , , , .
"?" , " ":
preg_match_all("/%.*?%/", "%hey%_thereyou're_a%rockstar%\nyo%there%", $matches);
, , - , , , , .