Non-greedy (.*?) stopped at the first ) found, which could be inside a comment like '# gracefully stop fallback (not caught by ...)'. Anchoring the closing paren to start-of-line (^\s*\)) ensures it only matches the array's actual closing paren, not ) inside comment text.