I am not getting expected results. Anyone pl check my code below and help
Expected result:
['(444)333-4444', '444-555-3424']
Actual result:
[('(444)333-4444', '(444)', '', '333', '-', '4444', '', '', ''), ('444-555-3424', '444', '-', '555', '-', '3424', '', '', '')]
Code:
tell_op = re.compile(r'''(
(\d{3}|\(\d{3}\))? # area code
(\s|-|\.)? # separator
(\d{3}) # first 3 digits
(\s|-|\.) # separator
(\d{4}) # last 4 digits
(\s*(ext|x|ext.)\s*(\d{2,5}))? # extension
)''', re.VERBOSE)
oo = tell_op.findall('this is my phone number (444)333-4444, 444-555-3424')
print(oo)