Linked Questions

Popular Questions

Python Findall not finding anything

Asked by At

I am learning about Regex and am stuck with this code:

import re

resume = '''
    (738) 383-5729
    (373) 577-0492
    (403) 443-2759
    (375) 880-8576
    (641) 576-2342
    (951) 268-8744
    '''

phoneRegex = re.compile(r'\d')

mo = phoneRegex.findall(resume)

print(mo.group())

When I try with search instead of findall, it works. But it can't find any match with findall.

What am I doing wrong?

Related Questions