What is the output of the following Python program?
import re
text = "one two\nthree four"
print(re.findall(r"^\w+", text), re.findall(r"^\w+", text, re.M), re.findall(r"\w+$", text, re.M))
Without re.M, ^ matches only at the very start. With it, ^ and $ match at every line start and end.