Revert "Use isdigit which is more flexible"

This reverts commit f62b1da37f8db30845551cd43f442265fe6c5b90.