Answers for "python regex match until first occurrence"

0

python regex match until first occurrence

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}')
Posted by: Guest on April-20-2022

Python Answers by Framework

Browse Popular Code Answers by Language