What you really want is to _remove_ whatever comes after either "cats" or, if the thing after "cat" is not an s, "cat".
But if you're reading comma-separated fields, you can just use `read`:
IFS=, read base idx comment <<<"$INPUT"
e.g.
for INPUT in file file, file,8 file,88 file,8,comment file,88,comment \
file,8a file,a8 file,a8,comment file,8a,comment file,8a,com,ment \
file,8,com,ment file,8,comm,9 file,8,comm,9a file,8,comm,a9; do
IFS=, read base idx comment <<<"$INPUT"
printf '\n%8s: %s\n' INPUT "$INPUT"
printf '%8s:\t%s\n' base "$base"
printf '%8s:\t%s\n' idx "$idx"
printf '%8s:\t%s\n' comment "$comment"
done
INPUT: file
base: file
idx:
comment:
INPUT: file,
base: file
idx:
comment:
INPUT: file,8
base: file
idx: 8
comment:
INPUT: file,88
base: file
idx: 88
comment:
INPUT: file,8,comment
base: file
idx: 8
comment: comment
INPUT: file,88,comment
base: file
idx: 88
comment: comment
INPUT: file,8a
base: file
idx: 8a
comment:
INPUT: file,a8
base: file
idx: a8
comment:
INPUT: file,a8,comment
base: file
idx: a8
comment: comment
INPUT: file,8a,comment
base: file
idx: 8a
comment: comment
INPUT: file,8a,com,ment
base: file
idx: 8a
comment: com,ment
INPUT: file,8,com,ment
base: file
idx: 8
comment: com,ment
INPUT: file,8,comm,9
base: file
idx: 8
comment: comm,9
INPUT: file,8,comm,9a
base: file
idx: 8
comment: comm,9a
INPUT: file,8,comm,a9
base: file
idx: 8
comment: comm,a9