正则表达式没有关闭跨度

I'm a bit at a loss. The below regex works as expected:

$src_data = preg_replace("/&quot;(.+?)&quot;/", "<span class=\"src_att\">$0</span>", $src_data);
$src_data = preg_replace("/'(.+?)'/", "<span class=\"src_att\">$0</span>", $src_data);

However, this one fails to close the span:

$src_data = preg_replace("/\/\/(.+?)
/", "<span class=\"src_com\">$0</span>", $src_data);

Sure enough it's something trivia but I fail to see the error. Any help appreciated, thanks.

EDIT:

$src_data may be anything, e.g. a single line or multiple lines. The below is an example with single quotes - awhich works as expected:

$ds_type = array ('Bytes', 'KiB', 'MiB', 'GiB', 'TiB');

Albeit, trying to match a comment fails to add the closing span:

//** this is just a comment

The output is renderd fine, but obviously the mark-up is invalid due to the missing span.

Hate doing this, but since it's fixed I'll answer myself.

$src_data = preg_replace("/\/\/(.*?)$/m", "<span class=\"src_com\">$0</span>", $src_data);

Changing .*+? to .*? in conjunction with $/m was all it took. Did I mention trivia... Thanks all around.