Help for this page
$ret = $1 if $g =~ /\n\s*\n((?m:^#.*\n)+)$id/;
/\n\s*\n # This matches your blank line between comments. ( # Capture into $1. ... ) # End of $1 capture. $id # This is the key you're looking for. /x