A possibly redundant flag

Report a typo

import re

string = '''I love dogs,
I love cats'''
result = re.findall('^I', string, re.MULTILINE)
print(result)

Is the re.MULTILINE flag necessary in the function above to match all I's in the string?

Select one option from the list
___

Create a free account to access the full topic