Match numbers

import re

line = 'There is a phone number 12345 in this row and an age: 23'

match ='\d+', line)
if match:
    print(  # 12345

Use raw strings for regular expression: r'a\d'. Especially because \ needs it.

It matches the first occurrence. Here we can see that the group(0) call is much more interesting than earlier.