The question is give a regular expression which defines a regular language.
Question: The language over {0,1} consisting of all strings which either have length less than 3 or have 0 as their third character.
Answer: null|(0|1){1,2}|(0|1){2}0(0|1)*
I understand how to do part of it but I don't understand what the {1,2} and {2} means in the answer.
It's an amount. (0|1){1,2) means between (inclusive) 1 and 2 instances of a 0 or 1. This covers the length less than 3 scenario.
{2} means exactly two. So you want exactly 2 instances of either a 0 or 1, then you want a 0, then any number (*) of 0s or 1s afterwards.