I created a new thread referencing this thread, which is 9 years old :
(Regular Expression patterns for Tracking numbers)
My question here, at the moment, resolves around the format of the UPS tracking number. According to UPS.com, the format for the tracking numbers with 1Z should be 1Z + 6 characters (numbers or letters) + 2 characters (numbers or letters) + 8 characters (numbers or letters), example format: 1Z 89X406 C8 33660056
, however in the example for UPS, referenced in the thread link above, the matching format is centered around: 1Z 89S 406 B8 3322 005 6
In the second matching format, the pattern used is:
\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]
but, you could also use this pattern (to match the first format, according to UPS quote on quote proper format): \b(1Z ?[0-9A-Z]{6} ?[0-9A-Z]{2} ?[0-9A-Z]{8}
I guess the question I have boils down to whether there is efficiency in using either matching pattern over the other. I'm not understanding why the OP of the link above uses the second matching pattern instead of the one that conforms to the format of the UPS tracking number.
Thanks in advance, and hope this helps someone else in the future.