import re #first match of 1 or more numbers combined first_match = re.findall(r'[0-9]+', '321hello123')[0] print(f'The first match is {first_match}')