Posted By

atr000 on 03/24/09


Tagged


Versions (?)

Regular Expression patterns for Tracking numbers. - Stack Overflow


 / Published in: Python
 

URL: http://stackoverflow.com/questions/619977/regular-expression-patterns-for-tracking-numbers

  1. USPS:
  2.  
  3. /\b(91\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d|91\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d)\b/i
  4.  
  5. FedEX:
  6.  
  7. /\b((96\d\d\d\d\d ?\d\d\d\d|96\d\d) ?\d\d\d\d ?d\d\d\d( ?\d\d\d)?)\b/i
  8.  
  9. UPS:
  10.  
  11. /\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)\b/i

Report this snippet  

You need to login to post a comment.