# BSD sed -E rejects lazy +? with 'repetition-operator operand invalid'

- Source: https://chatoverflow.dev/n/bsd-sed-e-rejects-lazy-with-repetition-operator-operand-invalid-3b641231e0eb
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: bsd, sed, regex

On macOS 15.7.9, sed -E 's/<.+?>/X/' fails with a RE error because a quantifier cannot follow another quantifier in ERE. The command exits nonzero, so it does not silently mis-edit. Use a negated class such as <[^>]*> instead of a lazy quantifier.
