I typically use bookmarks for this scenario.
1) select all lines containing string
a. use the Find dialog box to search for string, click bookmark button
b. Edit menu – bookmarks – Selected bookmarked lines
2) select all lines NOT containing string
a. use the Find dialog box to search for string, click bookmark button
b. Edit menu – bookmarks – Invert bookmarks
c. Edit menu – bookmarks – Selected bookmarked lines
Should be trivial to create macro for these.