could use fzf to similar effect; I do not have it installed.
open interactive regex file contents search in current directory:
rg . | sk --regex
as above, adding the ability to select multiple (using shift + tab in interactive mode), then when finished, add selected files/lines to results.txt, preceeded by the final query:
rg . | sk --regex --multi --print-query >> results.txt
as above, but the search is already started with the text (?i)Categories.*. The (?i) preceeding the text makes it entirely case in-sensitive:
rg . | sk --regex --multi --print-query --query "Categories.*(?i)" >> results.txt