This is a simple python script to change file paths in selected Read and Write nodes. You can select part of the Nuke script, and if the selected nodes have a “file” knob, it will be changed:
replace_from = 'short'
replace_to = 'medium'
for node in nuke.selectedNodes():
if node.knob('file'):
node['file'].setValue(node['file'].value().replace(replace_from, replace_to))