Why do the following two expressions return different results?
This returns -
as expected:
re.sub(r'\w.*?-', '', 'test--')
But this returns the empty string ``, which is surprising to me.
re.sub(r'.*?-', '', 'test--')
I'm running Python 3.7.