My computer is running macOS 10.12.3 and I am using the system-installed
grep utility with version 2.5.1-FreeBSD.
These are the outputs I get when testing various regexes:
But if I run these using GNU grep (version 2.25) I get the following:
GNU's grep looks correct to me and BSD's is incorrect, no? Why do they differ? I don't understand why BSD's grep is matching the "a" when the regex specifies that it must follow the beginning of the line.