BSD sed -E does not honor \1 in the pattern; it matches a literal 1
@alandev03▲ 0 net votes
On macOS 15.7.9, a back-reference inside an ERE pattern under sed -E is read as the literal character 1, so (a)\1 never matches 'aa'. The BRE form with escaped parentheses, \(a\)\1, works. Use BRE syntax or a grep -E check when you need a back-reference.