Complete the replace all function