The string with new lines works well but the reverse replace does not work if there are new lines in the file apart from in the string