I found that on my system, sed is aliased to sed -E
So instead of removing this alias which I use quite a lot actually, I decided to update the _known_hosts_real function in the /usr/share/bash-completion/bash_completion script (which I think is not really recommanded) :
$ type _known_hosts_real | grep -w sed local hosts=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "${config[@]}" );
by replacing sed -ne by command sed -ne, this way :
# append any available aliases from config files if [[ ${#config[@]} -gt 0 && -n "$aliases" ]]; then local hosts=$( command sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "${config[@]}" ) COMPREPLY+=( $( compgen -P "$prefix$user" \ -S "$suffix" -W "$hosts" -- "$cur" ) ) fi
However, those changes are going to be lost when the bash-completion package gets updated.
sedis aliased to\sed -Eon my system. I'm searching where in the bash-completions scripts, this particularsedcall is done ...