Additional note, according to POSIX regex standard:
"An ordinary character is a BRE that matches itself: any character in the supported character set, except for the BRE special characters listed in BRE Special Characters.
The interpretation of an ordinary character preceded by an unescaped <backslash> ( '\\' ) is undefined, except for: [...]"
which means that escaping ordinary characters (like \a) has undefined behaviour, thus I think it should not be matched.
So having EGexecute match 'a' to '\a' is incorrect, and instead we should remove the matching and make sure it's not printed. That would make my patch correct.

Reference: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_03

Looking forward to feedback.

Best regards,
Tomasz Dziendzielski

pon., 18 paź 2021 o 07:10 Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> napisał(a):
Also, even if we assume it should return a match (which I think it shouldn't), then there's a second bug in print_line_middle, because why would it print anything if there was no match?

Best regards,
Tomasz Dziendzielski