I need a single regex that I can use in Javascript that would allow me to extract just the tracking number from two different formats of plain text order confirmation emails:
First confirmation email:
(the tracking number is always the line right below "Tracking Number")
Tracking Number
1ZA828Y12313205351
Second confirmation email:
(the tracking number is always on the same line, after the colon and a (possibly) variable number of space characters)
Carrier Tracking Number : 582612345988
Also, just to clarify: The tracking numbers will always be any combination of capital letters and numbers (and will not necessarily start with "1Z").
Try this.Just grab the capture or group.See demo.
https://regex101.com/r/nS2lT4/28