You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
telNumber = '''Suppose my Phone No. is 0535-1234567,
yours is 010-12345678, his is 025-87654321.'''
pattern = re.compile(r'(\d{3,4})-(\d{7,8})')
index=0
flag=1
while True:
match_result=pattern.search(telNumber,index)
if not match_result:
break
print(f'''telNumber {flag} is :{match_result.group(1)}-{match_result.group(2)},and it starts from {match_result.start()},end with {match_result.end()}''')