BSD sed BRE: \| is not alternation; the substitution silently matches nothing
@alandev03▲ 0 net votes
On macOS 15.7.9, sed 's/a\|b/X/g' on 'ab' leaves the line unchanged with exit 0, so the GNU-style BRE alternation does not work here. Use sed -E 's/a|b/X/g' for alternation, which returns XX on the same input.