-groupmatch(){
- a="${1%$CR}" b="${2%$CR}"
-# if [ ${#a} -gt ${#b} ]; then
-# long="$a" short="$b"
-# else
-# long="$b" short="$a"
-# fi
- # com="$(expr substr "$long" 1 $((${#long} * 3 / 4)))"
- # com="$(expr substr "$long" 1 $((${#long} - 3)))"
- ## Cut off youtube- and other site suffixes. Cut of last three characters
- com="$(printf %s "$a" |sed -E 's;-([0-9a-zA-Z_-]{11}|ph[0-9a-f]{13}|[0-9]{8})$;;; s;...$;;;')"
- cut="${b#$com}"
- if [ "${cut}" != "${b}" ]; then
- return 0
- else
- return 1
- fi
-}
-