diff --git a/app/lib/viewableGrid.ts b/app/lib/viewableGrid.ts index 6a6ee1f9..5231d6ef 100644 --- a/app/lib/viewableGrid.ts +++ b/app/lib/viewableGrid.ts @@ -671,7 +671,7 @@ export function getRefs(grid: CluedGrid): [Set[], RefPosition[][]] { const refPos: RefPosition[] = []; let match; const re = - /(?(,? ?(and)? ?\b\d+-? ?)+)(?a(cross(es)?)?|d(owns?)?)\b/gi; + /(?=(?(,? ?(and)? ?\b\d+-? ?)+))\k(?a(cross(es)?)?|d(owns?)?)\b/gi; while (!e.clue.startsWith('!@') && (match = re.exec(e.clue)) !== null) { const dirString = match.groups?.dir?.toLowerCase(); if (!dirString) {