In Python re, what does this tuple evaluate to?
import re (bool(re.search(r'^abc$', 'abc\n')), bool(re.search(r'^abc\Z', 'abc\n')))
- (True, False)
- (False, False)
- (True, True)
- (False, True)
In Python
Play Regex ▸
$ also matches just before a trailing newline, while \Z matches only at the very end.