stream editor:

sed -e 's^./([/foot/])$/[1] && /([/hole/])/[2] [1]/[2]'