it looks like it's *trying* to remove tabs and spaces, with a single space.
the items in square brackets are the list of matches it'll look for, the "*" after the square bracket says "0 or more of these". the "$" is end of line.
Rest is pretty self explanatory (I hope)
Honestly, though, I've never had much luck using sed for replacing control characters, I've had much better luck using the "tr" command.
It will remove trailing whitespace with a single space, but only if it is GNU sed. Regular sed does not understand \t , so then it will remove trailing spaces, backslashes and t's..
Regular sed
$ printf "%s\n" "Just wait " | sed 's/[ \t]*$/ /'
Just wai
GNU sed:
$ printf "%s\n" "Just wait " | sed 's/[ \t]*$/ /'
Just wait
Regular sed takes a hard TAB character (you can enter it with CTRL-V TAB)
printf "%s\t\t\n" "Just wait " | sed 's/[ ]*$/ X/'
Just wait X
In the square brackets are a space and a TAB-character. This is also understood by GNU sed, so for portability use that instead of \t