Python's regex anchors `^` and `$` have unexpected behavior: the pattern `^Hello$` matches both `Hello` and `Hello\n`, which can be a security footgun. Python 3.14 now supports `\z` to match end-of-string without matching trailing newlines. Until Python 3.13 is deprecated, use `\Z` as an alternative, though be aware this

2m read timeFrom sethmlarson.dev
Post cover image

Sort: