Skip to content

Commit

Permalink
feat: UPS tracking numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
P403n1x87 committed Nov 4, 2021
1 parent 75e38c6 commit c287929
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pywhat/Data/regex.json
Expand Up @@ -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})$",
Expand Down
7 changes: 7 additions & 0 deletions tests/test_regex_identifier.py
Expand Up @@ -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"

0 comments on commit c287929

Please sign in to comment.