In the below input string i want to replace the "item" with "replaced_item" based on the regex search condition.
re.findall(r"(\bsee\b|\bunder\b|\bin\b|\bof\b|\bwith\b|\bthis\b)( *.{0,4})(item)","i have many roof item in the repeat item of the item inthe item downunder. with any item")
gives output:
[('of', ' the ', 'item'), ('with', ' any ', 'item')]
I want to replace the "item" keyword in the above matched phrases to "replaced_items".
Expected output: i have many roof item in the repeat item of the replaced_item inthe item downunder. with any replaced_item