On 4/5/21 11:20 am, Mats Wichmann wrote: > On 5/3/21 7:09 PM, Phil wrote: import re result = re.search(r'\b' + 'this' + '\W', test) print(result.group()) The output is 'this,' ,which is based on a white-space between words rather than punctuation. The search continues. -- Regards, Phil