getDigits function

Gets the data starting with some specific digits