How to use "sed" to find and replace

After Worldpay recently changed to use the RBS system, I was tasked with finding every instance of in our forms and replacing it with There appeared to be thousands of files and I wasn't going to do it manually…

A quick google later and I found that you can easily use a combination of Grep (to find the files) and sed (a text stream editor) to change the content. Notice how in sed, the find and replace strings have to have the forward slash escaped as we're using it as delimiter.

grep "" . -Rl | xargs sed -i 's/\/wcc\/purchase/\/wcc\/purchase/g'

This probably isn't perfect - but it did the job for me and I hope it helps anyone else that stumbles upon it :)