Advertisement
avisrivastava254084

Untitled

Sep 30th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. def validate_format(number):
  2.     length = len(number)
  3.     if length == 14:
  4.         if (re.match(formats[0], number)):
  5.             return True
  6.         return False
  7.     if length == 12:
  8.         if (re.match(formats[1], number)):
  9.             return True
  10.         return False
  11.     if length == 11:
  12.         if (re.match(formats[2], number)):
  13.             return True
  14.         return False
  15.     if length == 10:
  16.         if (re.match(formats[3], number)):
  17.             return True
  18.         return False
  19.     return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement