As an example pulled from work, say there is a bug in an app where users input their zip code and get pricing from an API. In the US, zip codes are 5 numeric digits, but it validation is failing for zip codes like 06010 in Connecticut. You realize that the leading zero is being stripped when the zip is interpreted as an integer.
A bad job would be to hard code 06010 in a white list. You'll get another bug report when someone tries 06011.
A good job would be to treat the zip as a string to preserve the leading zero and use regex to check for 5 digits. The downside is that "00000" passes validation but is not a real zip code.
A first class job would be to integrate an actual zip code validation API, like the one from USPS where you feed it a zip and it returns data about it. 00000 would fail, but 00501 would pass. The advantage is that if the US ever updates zip codes to include letters or an additional digit, you don't have to update validation rules on your side.