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.
I think this might be a bug in FreeBSD's grep. There's a bug report with similar issues.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments