What will be the output of the following code:
import re
pattern = re.compile(r'd+')
result = pattern.search('There are 5 apples and 3 oranges.')
print(result.group())
pattern = re.compile(r'd+')
result = pattern.search('There are 5 apples and 3 oranges.')
print(result.group())
A. 5
B. An error will occur
C. 3
D. ['5', '3']
Answer: Option D

Join The Discussion