There's no need to use capture groups (although &
is a one in a way):
echo "taco my-fish-tacos my_fish_tacos" | sed 's/[^ _-]*/u&/g'
The output:
Taco My-Fish-Tacos My_Fish_Tacos
The escaped lower case "u" capitalizes the next character in the matched sub-string.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…