wgrep works well for every line in context search like grep -C 2. It also works for grepmail, special grep-like program for mailboxes. You can edit each line of output.

How to force pcregrep with multiline request like ^[ \t]+-.*\n +CLOCK to cooperate with wgrep correctly (with ability to edit each line, not only the first)?

1 Answer 1


I have created such one-liner

f=filename(s).org; diff --unchanged-group-format='' <(grep -i -nH -e  [.]* ${f}) <(pcregrep -v -M -nH -e "^[ \t]+-.*\n +CLOCK" ${f})

which is used instead of grep command in grep-mode.

  • If this post resolves the problem, please accept your own answer so we can mark it as done.
    – Dan
    Apr 24, 2016 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.