3 ms·
POSIX BREs do support backrefs. See section 9.3.6 BREs Matching Multiple Characters point 3 at https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap
by fanf2 2y ago
POSIX BREs do support backrefs. See section 9.3.6 BREs Matching Multiple Characters point 3 at https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_03 https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1...
Backref support was added to grep between 6th edition and 7th edition unix
6th edition grep manual: http://man.cat-v.org/unix-6th/1/grep http://man.cat-v.org/unix-6th/1/grep
7th edition grep manual: http://man.cat-v.org/unix_7th/1/grep http://man.cat-v.org/unix_7th/1/grep
Both of those refer to ed(1) for the syntax of regular expressions
6th edition ed manual: http://man.cat-v.org/unix-6th/1/ed http://man.cat-v.org/unix-6th/1/ed
7th edition ed manual: http://man.cat-v.org/unix_7th/1/ed http://man.cat-v.org/unix_7th/1/ed
POSIX EREs do not support backrefs. This goes back to the 1970s because egrep used a different regex matching algorithm to grep — egrep compiled the regex to a DFA which could not match backrefs, unlike grep’s nondeterministic algorithm — and egrep also had different syntax.