mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 08:17:01 +00:00
Added doctest (#5182)
This commit is contained in:
parent
7578e0b920
commit
97562c19f8
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user