Equivalence Classes Of Repetition MetaChars
$ echo 'abc123' | sed -E 's/[[:alpha:]]*/!/'
!123
$ echo 'abc123' | sed -E 's/[[:alpha:]]{0,}/!/'
!123$ echo 'fix the spacing' | sed -E 's/[ ]+/ /g'
fix the spacing
$ echo 'fix the spacing' | sed -E 's/[ ]{1,}/ /g'
fix the spacing$ echo '#1, 2, 1oz' | sed -E 's/#?1/ONE/g'
ONE, 2, ONEoz
$ echo '#1, 2, 1oz' | sed -E 's/#{0,1}1/ONE/g'
ONE, 2, ONEozLast updated