Skip to content

Commit

Permalink
fix: Correct serial number group for DHL express numbers, split J* nu…
Browse files Browse the repository at this point in the history
…mbers into their own group and remove validation, since it appears they have none (#100)
  • Loading branch information
jkeen authored Oct 20, 2023
1 parent 0ad724d commit 24c6f03
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions couriers/dhl.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "DHL Express",
"id": "dhl_express",
"regex": "\\s*(?<SerialNumber>(J[A-Z][A-Z][A-Z])?([0-9])?([0-9]\\s*){9})(?<CheckDigit>([0-9]\\s*))",
"regex": "\\s*(?<SerialNumber>([0-9]\\s*){9,10})(?<CheckDigit>([0-9]\\s*))",
"validation": {
"checksum": {
"name": "mod7"
Expand All @@ -14,21 +14,37 @@
"tracking_url": "http://www.dhl.com/en/express/tracking.html?brand=DHL&AWB=%s",
"test_numbers": {
"valid": [
"JVGL0999999990",
"3318810025",
"73891051146",
"8487135506",
"1099255990",
"3821724944",
"3318810036",
"3318810014"
],
"invalid": [
"3318810010",
"3318810034",
"JVGL3099999999",
"3318810011"
]
}
},
{
"name": "DHL Express (Piece ID)",
"id": "dhl_express_piece_id",
"regex": "\\s*(J[A-Z]{2,3})(?<SerialNumber>([0-9]\\s*){9,10})",
"validation": {},
"tracking_url": "http://www.dhl.com/en/express/tracking.html?brand=DHL&AWB=%s",
"test_numbers": {
"valid": [
"JJD0099999999",
"JVGL0999999990"
],
"invalid": [
"XJD0099999998"
]
}
},
{
"name": "DHL E-Commerce",
"id": "dhl_ecommerce",
Expand Down

0 comments on commit 24c6f03

Please sign in to comment.