I need to find a the whole word within a string which contains a sub string.
For instance If replacement is a string and I will search for replace , so it will match replacement and it should return replacement.
Here is what I tried
>>> a = 'replacement replace filereplace filereplacer'
>>> re.findall(r'replace',a)
['replace', 'replace', 'replace', 'replace']
But what I need is:
['replacement', 'replace', 'filereplace', 'filereplacer']