Examveda

What will be the output of the following Python code?
import re
s = "A new day"
m = re.match(r'(.*)(.*?)', s)
print(m.group(2))
 
print(m.group(0))

A. No output
A new day

B. No output
No output

C. [‘A’, ‘new’, ‘day’]
(‘A’, ‘new’, ‘day’)

D. Error
[‘A’, ‘new’, ‘day’]

Answer: Option A


This Question Belongs to Python Program >> Regular Expressions In Python

Join The Discussion

Related Questions on Regular Expressions in Python