You probably want grep to use Perl regular expressions. Unfortunately, the older version of grep ((BSD grep) 2.5.1-FreeBSD) that ships with MacOS does not support them. However, you can get the latest version ((GNU grep) 3.6) by first installing HomeBrew [1] and the installing gnu grep (brew install grep). Once done, you instruct GNU grep to use PCRE [2] by passing ‘-P’ on the command line [3]. Let me know if you have questions on this.
BTW, Roger had walked me through this process. It is a pretty straightforward process once you get over using the terminal and the fear of breaking something.
Sorry, I appreciate your info, but I should have deleted that post months ago. What I said there is useless.