Subject: bug#68592: Grep 3.1 does not recognize regex beginning-of-line and end-of-line anchors (^ and $). on RHEL 8.9

From: Sam James <[email-masked]>
Date: Sat, 20 Jan 2024 01:22:19 +0000

Erich Wolz <[email-masked]> writes:

> Steps to reproduce:
> 1) create a file containing the following lines:
>    foo bar baz
>    bar foo baz
>    baz foo bar
>    bar baz foo
>    foo baz bar
>    baz bar foo
> 2) The command "grep '.*bar$' filename1"  should find the two lines ending in "bar" but it does not.
> 3) create a file containing the following lines:
>    foo
>    foo bar
>    baz foo
>    foo bar baz
>    baz bar foo
> 4) The command "grep '^foo$' filename2" should find only the first line but it does not.
>

If you cannot reproduce this with the latest release of GNU grep (3.11),
please report it to RHEL instead. 

It works OK for me with 3.11.