1. How do you make a quantifier non-greedy in Python regex?
Adding question mark to star, plus, or brace quantifiers switches them to the shortest match. For example, star question matches as little as possible. This is useful for extracting the smallest block between tags or quotes.
import re
re.findall('<p>.*?</p>', html, flags=re.S)