Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using regex lookahead, egrep

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

like image 258
James Raitsev Avatar asked Sep 06 '25 04:09

James Raitsev


1 Answers

Extended regular expression doesn't have positive look-ahead feature. See the regex flavor comparison

like image 57
Prince John Wesley Avatar answered Sep 07 '25 21:09

Prince John Wesley