Re: [Clip] Remove all lines not containing something
- --- In email@example.com, Don <don@...> wrote:
> Your look behind works only if it is at the end of the line.Yes, Don, that's the way it works because it was adapted to the data in your first message...
Different from these data, now the substrings in question ('Grand Blanc' or 'Alpena') are not to be found at the end of line but on any position in line. So the command to delete all lines that do NOT contain 'Grand Blanc' or 'Alpena' can be a little bit shorter...
^!Replace "^(?!.*(Grand Blanc|Alpena)).*(\R|\Z)" >> "" WARS
However, your latest information shows that this job is more based on *positive* criteria (find 'Grand Blanc' or 'Alpena') than on *negative* criteria (exclude 'com' or 'ru' in your first message). So, in this case, it probably is of no advantage to work with a Lookaround. Maybe it will suffice just to run something like...
^!SetClipboard ^$GetDocListAll("^.*(Grand Blanc|Alpena).*(\R|\Z)";$0)$
^!Toolbar New Document
If you want to overwrite the original list you could try...