I\'m trying to find and replace one or more occurrences of a character using sed on a mac, sed from the BSD General Commands.
I try:
echo \"foobar\"
Using the /g flag, s/o//g is enough to replace all o occurrences.
Why + doesn't work as expected: in old, obsolete re + is an ordinary character (as well as |, ?). You should specify -E flag to sed to make it using modern regular expressions:
echo "foobar" | sed -E -e "s/o+//"
# fbar
Source: man 7 re_format.