'How else can i write this django custom validation othere than try and except
how else can i frame this django custom validation function to validate US phone number other than try and except block
def validate(value):
if re.match(r"[+]?[1\s-]*[\(-]?[0-9]{3}[-\)]?[\s-]?[0-9]{3}[\s-]?[0-9]{4}",value):
return True
else:
return False
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
