$ sed --help BusyBox v1.31.1 () multi-call binary. [...] The commit <https://git.busybox.net/busybox/commit/?id=f36635cec6da728fe06b849089ce2f6c1690dc67> introduced this behavior to address the bug with `echo "aah" | sed 's/^a/b/g'`. However, this breaks other regexs, such as: $ echo 'a b c' | sed -E 's/^a|b|c/d/g' d b c Simply reordering the clauses so that '^' doesn't appear at the start makes it working as intended: $ echo 'a b c' | sed -E 's/b|^a|c/d/g' d d d
I'm still seeing this in 1.33.1 and master. However, removing the (updated version of) the commit mentioned by the OP does not fix echo 'a b c' | sed -E 's/^a|b|c/d/g' ... but neither does it break `echo "aah" | sed 's/^a/b/g'`