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?
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?
Create a free account to access the full topic