[Solved] How to make sure the beginning of two strings match until the last word(s)? [closed]


Remove the last word from success and assign to failure:

import re

success = "Today's day is Wednesday";
failure = re.sub(r'\w+$', '', success)

solved How to make sure the beginning of two strings match until the last word(s)? [closed]