I want to recursively search through a directory with subdirectories of text files and replace every occurrence of {$replace} within the files with the contents of a multi l
Use:
pip3 install manip
This lets you use a decorator to create something like:
@manip(at='.php$', recursive=True) # to apply to subfolders
def replace_on_php(text, find, replacement):
return text.replace(find, replacement)
Now in your prompt you should be able to call
replace_on_php('explode', 'myCustomExplode', path='./myPhPFiles', modify=True)
and this should make the function apply itself on the entire folder.