What output results when the following commands are entered in Python interactive mode?
In Python regular expressions, .* is greedy by default. Between the first and final literal tag, it consumes the longest possible sequence, so re.findall() returns one string: tag to go tag to sans tag.
.*
tag
re.findall()
tag to go tag to sans tag
Community Discussion