mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-31 06:33:44 +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
|
True
|
||||||
>>> indian_phone_validator("+91-1234567899")
|
>>> indian_phone_validator("+91-1234567899")
|
||||||
False
|
False
|
||||||
|
>>> indian_phone_validator("+91-9876543218")
|
||||||
|
True
|
||||||
"""
|
"""
|
||||||
pat = re.compile(r"^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$")
|
pat = re.compile(r"^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$")
|
||||||
match = re.search(pat, phone)
|
match = re.search(pat, phone)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user