Serhiy Storchaka added the comment:
I concur with Matthew. I tested several implementations in different
programming languages. Perl, PHP and Java behave the same way as Python. Sed,
awk and Go behave other way. We can argue that one or other way is "better",
but it looks subjective, and in
Terry J. Reedy added the comment:
Python regexes match slices of a Python string s. The latter include the
len(s)+1 empty slices of s. An re Match gives both the slice itself as match
attribute and its slice coordinates (span) in the searched string.
https://docs.python.org/3/library/re.htm