If you're wondering why your original approach doesn't work,
re.split(r'\wd',"dord word")
It finds all instances of the letter / number / underscore before "d" and breaks down into what it finds. So he did this:
do [rd] wo [rd]
and separate the lines in brackets by deleting them.
Also note that this can be shared in the middle of words, therefore:
re.split(r'\wd', "said tendentious")
would divide the second word into two.
source share