Vaildating UPS tracking number

Posted on 2007-03-26
Last Modified: 2008-01-09
How to validate UPS tracking number, if user enters tracking number in a textbox there a regex expression for validating UPS tracking number.
Question by:prasadrao007
  • 3
  • 2
LVL 84

Expert Comment

ID: 18798054
Can you describe the difference between a valid UPS tracking number and an invalid one?
LVL 54

Accepted Solution

b0lsc0tt earned 500 total points
ID: 18801736
UPS offers tools (I believe HTML or XML compatible) to validate the number.  It is part of their tools package.  They are available to customers or a developer.  Take a look at

Without details on what makes a valid number we would not be able to make an expression.  That information may be hard to find from UPS but they do have a summary at  If you still want an expression, based just on the information there or information you provide, then let us know.  Let me know if you have a question about anything here.

LVL 84

Expert Comment

ID: 18801874
assuming 9 means [0-9] and Z means [A-Z]
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

LVL 54

Expert Comment

ID: 18802030
>> assuming 9 means [0-9] and Z means [A-Z]

From my experience the 9 is 0-9 but the Z is just the letter Z (I don't know that for sure though).  I think the letter T is the same but it looks like the expression already got that.  I believe that would just be one minor change to the expression above (see below).  All credit to Ozo for the great expression which seems to check for the 3 common formats.



Author Comment

ID: 19366232
sorry for not replying early ...i guess i didnt provide enough information in my question for validating UPS tracking number..thanks for the replies though..
LVL 54

Expert Comment

ID: 19366305
Did you try the expressions we made up with the info available?  Did you still need help with this or have a question though?  I noticed the B grade and that seems a little odd since you never participated or asked for more help.  If there is something we can still help with then please let us know.  I will be happy to provide whatever help I can and you have some very good experts here to help with an expression.  It is nice to have a chance to earn the A.

Thanks for the fun question but the grade is puzzling and disappointing.


Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RegEx help in C#.NET 8 55
Parse keys to return portion of key with Regex 3 101
Removing text between BBCODE tags in Excel 3 67
Coldfusion RegEx 8 62
I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now