Fix whitespace handling in digit matching