improve numeric only id detection

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Merge pull request #6063 from vieux/improve_number_detection

improve numeric only id detection