Examples for the replace filter Original file line1 line2 Output file line1 add1 add2 Filter addlines = "add1\nadd2\n" filter_lines '/example/replace' do filters(replace: [/^line2$/, addlines]) end