This smells like homework (and quite a cute test too)...
Anyhow, here's one way. Use 'sed' to remove crab, the commas and to add a newline. You now have your input as a column, which 'sort' can sort. Then use awk to re-add the commas and transform the column back to a row.
Code:
echo "gina, crab.george, john, joe, crab.mckay" | sed 's/crab\.//g;s/, */\
/g' | sort | awk '{printf (comma"%s",$0); comma=","}'
Damian