Implement replace and replace-find actions