Answers for "python regex find first"

0

python regex find first

>>> re.search('\d+|$', 'aa33bbb44').group()
'33'
>>> re.search('\d+|$', 'aazzzbbb').group()
''
>>> re.search('\d+|$', '').group()
''
Posted by: Guest on August-06-2020
0

python regex find first

>>> re.findall('\d+|$', 'aa33bbb44')[0]
'33'
>>> re.findall('\d+|$', 'aazzzbbb')[0]
''
>>> re.findall('\d+|$', '')[0]
''
Posted by: Guest on August-06-2020

Python Answers by Framework

Browse Popular Code Answers by Language