Using Grep with Pattern File and PCRE

view full story

http://www.linuxquestions.org – I would like to write a newline delimeted rules file using PCREs for use with the grep command. Grep has the option -f to obtain the search pattern from a file, and option -P to search using PCREs. However, these two options do not work together. The -f option only seems to work with fixed string rules. A friend previously helped me get around this limitation somehow, but I can't remember how he did it. I also would like the ability to add comments at the end of each rule in the file. Example Rules File- Code: '^John.*Sally$'                  & (HowTos)