Python Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Start Python Course
Register
Check phone numbers
-2
Author: It's me
Dark
Public
Save
PY
py
1
2
3
4
5
6
7
8
import
re
s=
input
()
pattern=
"[189]\d{7}"
if
re.match
(
pattern
,
s
):
print
(
"Valid"
)
else
:
print
(
"Invalid"
)
Enter to Rename, Shift+Enter to Preview
OUTPUT