Added doctest (#5182)

This commit is contained in:
Rohanrbharadwaj 2021-10-10 23:30:04 +05:30 committed by GitHub
parent 7578e0b920
commit 97562c19f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,8 @@ def indian_phone_validator(phone: str) -> bool:
True
>>> indian_phone_validator("+91-1234567899")
False
>>> indian_phone_validator("+91-9876543218")
True
"""
pat = re.compile(r"^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$")
match = re.search(pat, phone)