I have the following text block containing names in their own line:
Sarah Jane Smith
Archie Jones
Micky Smith
Rose Tyler
Harriet Jones
Jack Harkness
John Smith
Martha Jones
Donna Noble
Using PHP, I want to delete all the lines that do NOT contain Jones and leave the lines containing Jones, as follows:
Archie Jones
Harriet Jones
Martha Jones
There are several answers that show how to delete lines that contain a word, but no answers that provide a method of deleting all those that don't contain the key string.