On the bright side, I substituted the checking of the presence of ':' by the presence of digits and included an additional test cases to check that this code behaves correctly.