const PENALTY_SCORE_PATTERN = /^\((\d+)\)\s+(\d+)$/; export const reorderPenaltyScore = (container: HTMLElement): void => { const scoreSpans = container.querySelectorAll('.Opta-Team-Score'); scoreSpans.forEach(span => { const text = (span.textContent || '').trim(); const match = text.match(PENALTY_SCORE_PATTERN); if (match) { const penaltyScore = match[1]; const matchScore = match[2]; span.textContent = `${matchScore} (${penaltyScore})`; } }); };