import re


val = "01012341234" #11자리 휴대폰 번호
pattern = r"^01[016789][1-9]\d{6,7}$"
# 동일한 표현방식 : pattern = "^01[016789][1-9]\\d{6,7}$"

if re.match(pattern, val):
    print("matched")
else:
    print("invalied")
d727854e0fcd09d929e7d22165db4b0e2b7a6627
<mask token>

<mask token>
if re.match(pattern, val):
    print('matched')
else:
    print('invalied')

<mask token>
val = '01012341234'
pattern = '^01[016789][1-9]\\d{6,7}$'
if re.match(pattern, val):
    print('matched')
else:
    print('invalied')

import re
val = '01012341234'
pattern = '^01[016789][1-9]\\d{6,7}$'
if re.match(pattern, val):
    print('matched')
else:
    print('invalied')

import re


val = "01012341234" #11자리 휴대폰 번호
pattern = r"^01[016789][1-9]\d{6,7}$"
# 동일한 표현방식 : pattern = "^01[016789][1-9]\\d{6,7}$"

if re.match(pattern, val):
    print("matched")
else:
    print("invalied")