The digits on your ticket must match in the correct order to win.
Here’s an example lottery draw, with two tickets, A and B.
Ticket A: The first 3 digits and the last 2 digits match, but the 4th digit is wrong, so this ticket only wins a “Matches first 23” prize.
Ticket B: Even though the last 5 digits match, the first digit is wrong, so this ticket doesn’t win a prize.
Prize brackets don’t ‘stack’: if you match the first 3 digits in order, you’ll only win prizes from the ‘Match 3’ bracket, and not from ‘Match 1’ and ‘Match 2’.