Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/geekcomputers/Python
/ phone_validation
Function
phone_validation
cli_master/validation_page.py:4–7 ·
view source on GitHub ↗
(phone_number)
Source
from the content-addressed store, hash-verified
2
3
4
def
phone_validation(phone_number):
5
# Match a typical US phone number format (xxx) xxx-xxxx
6
pattern = re.compile(r
"^\(\d{3}\) \d{3}-\d{4}$"
)
7
return
bool(pattern.match(phone_number))
8
9
10
# Example usage:
Callers
1
validation_page.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected