I was wondering if it’s possible to use regex with python to capture a word, or a part of the word (if it’s at the end of the string).
Eg:
target word – potato
string – “this is a sentence about a potato“
string – “this is a sentence about a potat“
string – “this is another sentence about a pota“
Thanks!
OUTPUT