strings.is_srilankan_phone_number

Attributes

phone

Functions

is_sri_lankan_phone_number(→ bool)

Determine whether the string is a valid sri lankan mobile phone number or not

Module Contents

strings.is_srilankan_phone_number.is_sri_lankan_phone_number(phone: str) bool

Determine whether the string is a valid sri lankan mobile phone number or not References: https://aye.sh/blog/sri-lankan-phone-number-regex

>>> is_sri_lankan_phone_number("+94773283048")
True
>>> is_sri_lankan_phone_number("+9477-3283048")
True
>>> is_sri_lankan_phone_number("0718382399")
True
>>> is_sri_lankan_phone_number("0094702343221")
True
>>> is_sri_lankan_phone_number("075 3201568")
True
>>> is_sri_lankan_phone_number("07779209245")
False
>>> is_sri_lankan_phone_number("0957651234")
False
strings.is_srilankan_phone_number.phone = '0094702343221'