Using regex lookahead, egrep
grep, regex, regex-lookarounds
Solution
Extended regular expression doesn't have positive look-ahead feature. See the regex flavor comparison
Problem
If your file contains ``` apples are good apple cider is also good ``` Why would `egrep '(?=apples)app' file` fail to pick up any lines? Using egrep 2.5.1 on MAC