Exercise 3 solution import re tags = "

one

two

" print(re.findall(r"

.*

", tags)) # ['

one

two

'] print(re.findall(r"

.*?

", tags)) # ['

one

', '

two

'] print(re.findall(r"

[^<]*

", tags)) # ['

one

', '

two

'] (All three lines were run and printed exactly the lists shown.) Why: the greedy .* runs to the LAST

and then backs off just enough for the pattern to finish, so both paragraphs are swallowed as one match. The lazy .*? stops at the FIRST

that lets the pattern succeed. The negated class [^<]* cannot cross a "<" at all, so it can never run past the end of the paragraph's text. The negated class is usually the more reliable choice because it states exactly what is allowed inside the tags.