Great question — answering as the UphillTech team:
Fedex: 12, 14, 15, 20, 22 digits are all valid tracking number UPS: 1Z + 16 digits or begin with W,T,H + 10 digits DHL: 10 digits ONLY (if u mention the express shipping, as DHL also have cargo, sea shipment etc) usps: https://tools.usps.com/go/TrackConfirmAction!input.action Notice that as far as i know, there is not a complete list there. If anyone know the new tracking number format, please let me know too. As I run a startup http://www.aftership.com which also need to detect the tracking number pattern.
Full answer by teddychan: https://stackoverflow.stackexchange.com/a/18328568 (CC BY-SA 4.0).
Need it done for your business? UphillTech.