'TKT-1043', 'BUG-77', or are malformed. Write ticket_numbers(refs) that pulls the integer part from every reference matching the PREFIX-DIGITS shape (letters, one hyphen, digits) and skips everything else — comprehension only, no regex.ticket_numbers(['TKT-1043', 'oops', 'BUG-77', 'X-Y-9'])
[1043, 77]
'oops' has no hyphen; 'X-Y-9' has two.
r.count('-') == 1 guards the split.
Use partition or split, then .isalpha() / .isdigit() checks.