Skip to content

Instantly share code, notes, and snippets.

View twpayne's full-sized avatar

Tom Payne twpayne

  • Zürich, Switzerland
  • 23:26 (UTC +01:00)
View GitHub Profile
@twpayne
twpayne / awb.py
Created October 25, 2012 14:24 — forked from fredj/awb.py
AWB (Airway bill) number validation
import re
def valid(awb):
m = re.match('\d{3}(?P<serial>\d{7})(?P<check>\d)\Z', awb)
return m and int(m.group('serial')) % 7 == int(m.group('check'))