diff --git a/pywhat/Data/regex.json b/pywhat/Data/regex.json index 43208fed..fe0db525 100644 --- a/pywhat/Data/regex.json +++ b/pywhat/Data/regex.json @@ -1286,6 +1286,23 @@ ] } }, + { + "Name": "UPS Tracking Number", + "Regex": "^(1Z[0-9A-Z]{6}[0-9]{2}[0-9]{8})$", + "plural_name": false, + "Description": null, + "Rarity": 1, + "URL": "https://www.ups.com/track?tracknum=", + "Tags": [ + "Tracking" + ], + "Examples": { + "Valid": [ + "1Z123ABC0012345678" + ], + "Invalid": [] + } + }, { "Name": "Google Cloud Platform API Key", "Regex": "(?i)^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$", diff --git a/tests/test_regex_identifier.py b/tests/test_regex_identifier.py index c441a1a0..6d4156e7 100644 --- a/tests/test_regex_identifier.py +++ b/tests/test_regex_identifier.py @@ -91,3 +91,10 @@ def test_match_description(match: str, description: str): ) def test_match_exploit(match: str, exploit: str): assert exploit in r.check([match])[0]["Regex Pattern"]["Exploit"] + + +def test_ups_tracking(): + tracking = "1Z123ABC0012345678" + (match,) = r.check([tracking]) + assert match["Matched"] == tracking + assert match["Regex Pattern"]["Name"] == "UPS Tracking Number"